@@ -443,10 +443,10 @@ RendererAgg::set_clipbox(const Py::Object& cliprect, R& rasterizer)
443443 double l, b, r, t;
444444 if (py_convert_bbox (cliprect.ptr (), l, b, r, t))
445445 {
446- rasterizer.clip_box (std::max (int (mpl_round (l )), 0 ),
447- std::max (int (height) - int ( mpl_round (b )), 0 ),
448- std::min (int (mpl_round (r )), int (width)),
449- std::min (int (height) - int ( mpl_round (t )), int (height)));
446+ rasterizer.clip_box (std::max (int (floor (l - 0.5 )), 0 ),
447+ std::max (int (floor ( height - b - 0.5 )), 0 ),
448+ std::min (int (floor (r - 0.5 )), int (width)),
449+ std::min (int (floor ( height - t - 0.5 )), int (height)));
450450 }
451451 else
452452 {
@@ -660,7 +660,7 @@ RendererAgg::draw_markers(const Py::Tuple& args)
660660 // Deal with the difference in y-axis direction
661661 marker_trans *= agg::trans_affine_scaling (1.0 , -1.0 );
662662 trans *= agg::trans_affine_scaling (1.0 , -1.0 );
663- trans *= agg::trans_affine_translation (0.0 , (double )height);
663+ trans *= agg::trans_affine_translation (0.5 , (double )height + 0.5 );
664664
665665 PathIterator marker_path (marker_path_obj);
666666 transformed_path_t marker_path_transformed (marker_path, marker_trans);
@@ -746,8 +746,8 @@ RendererAgg::draw_markers(const Py::Tuple& args)
746746 continue ;
747747 }
748748
749- x = ( double )( int )x ;
750- y = ( double )( int )y ;
749+ x = floor (x) ;
750+ y = floor (y) ;
751751
752752 // Cull points outside the boundary of the image.
753753 // Values that are too large may overflow and create
@@ -782,8 +782,8 @@ RendererAgg::draw_markers(const Py::Tuple& args)
782782 continue ;
783783 }
784784
785- x = ( double )( int )x ;
786- y = ( double )( int )y ;
785+ x = floor (x) ;
786+ y = floor (y) ;
787787
788788 // Cull points outside the boundary of the image.
789789 // Values that are too large may overflow and create
0 commit comments