@@ -350,7 +350,8 @@ RendererAgg::_draw_path(path_t &path, bool has_clippath, const facepair_t &face,
350
350
agg::trans_affine hatch_trans;
351
351
hatch_trans *= agg::trans_affine_scaling (1.0 , -1.0 );
352
352
hatch_trans *= agg::trans_affine_translation (0.0 , 1.0 );
353
- hatch_trans *= agg::trans_affine_scaling (hatch_size, hatch_size);
353
+ hatch_trans *= agg::trans_affine_scaling (static_cast <double >(hatch_size),
354
+ static_cast <double >(hatch_size));
354
355
hatch_path_trans_t hatch_path_trans (hatch_path, hatch_trans);
355
356
hatch_path_curve_t hatch_path_curve (hatch_path_trans);
356
357
hatch_path_stroke_t hatch_path_stroke (hatch_path_curve);
@@ -739,16 +740,19 @@ inline void RendererAgg::draw_text_image(GCAgg &gc, ImageArray &image, int x, in
739
740
740
741
set_clipbox (gc.cliprect , theRasterizer);
741
742
743
+ auto image_height = static_cast <double >(image.shape (0 )),
744
+ image_width = static_cast <double >(image.shape (1 ));
745
+
742
746
agg::trans_affine mtx;
743
- mtx *= agg::trans_affine_translation (0 , -image. shape ( 0 ) );
747
+ mtx *= agg::trans_affine_translation (0 , -image_height );
744
748
mtx *= agg::trans_affine_rotation (-angle * (agg::pi / 180.0 ));
745
749
mtx *= agg::trans_affine_translation (x, y);
746
750
747
751
agg::path_storage rect;
748
752
rect.move_to (0 , 0 );
749
- rect.line_to (image. shape ( 1 ) , 0 );
750
- rect.line_to (image. shape ( 1 ), image. shape ( 0 ) );
751
- rect.line_to (0 , image. shape ( 0 ) );
753
+ rect.line_to (image_width , 0 );
754
+ rect.line_to (image_width, image_height );
755
+ rect.line_to (0 , image_height );
752
756
rect.line_to (0 , 0 );
753
757
agg::conv_transform<agg::path_storage> rect2 (rect, mtx);
754
758
@@ -842,12 +846,15 @@ inline void RendererAgg::draw_image(GCAgg &gc,
842
846
agg::trans_affine mtx;
843
847
agg::path_storage rect;
844
848
845
- mtx *= agg::trans_affine_translation ((int )x, (int )(height - (y + image.shape (0 ))));
849
+ auto image_height = static_cast <double >(image.shape (0 )),
850
+ image_width = static_cast <double >(image.shape (1 ));
851
+
852
+ mtx *= agg::trans_affine_translation ((int )x, (int )(height - (y + image_height)));
846
853
847
854
rect.move_to (0 , 0 );
848
- rect.line_to (image. shape ( 1 ) , 0 );
849
- rect.line_to (image. shape ( 1 ), image. shape ( 0 ) );
850
- rect.line_to (0 , image. shape ( 0 ) );
855
+ rect.line_to (image_width , 0 );
856
+ rect.line_to (image_width, image_height );
857
+ rect.line_to (0 , image_height );
851
858
rect.line_to (0 , 0 );
852
859
853
860
agg::conv_transform<agg::path_storage> rect2 (rect, mtx);
0 commit comments