@@ -433,10 +433,10 @@ RendererAgg::set_clipbox(const Py::Object& cliprect, R& rasterizer)
433
433
double l, b, r, t;
434
434
if (py_convert_bbox (cliprect.ptr (), l, b, r, t))
435
435
{
436
- rasterizer.clip_box (std::max (int (mpl_round (l )), 0 ),
437
- std::max (int (height) - int ( mpl_round (b )), 0 ),
438
- std::min (int (mpl_round (r )), int (width)),
439
- std::min (int (height) - int ( mpl_round (t )), int (height)));
436
+ rasterizer.clip_box (std::max (int (floor (l - 0.5 )), 0 ),
437
+ std::max (int (floor ( height - b - 0.5 )), 0 ),
438
+ std::min (int (floor (r - 0.5 )), int (width)),
439
+ std::min (int (floor ( height - t - 0.5 )), int (height)));
440
440
}
441
441
else
442
442
{
@@ -650,7 +650,7 @@ RendererAgg::draw_markers(const Py::Tuple& args)
650
650
// Deal with the difference in y-axis direction
651
651
marker_trans *= agg::trans_affine_scaling (1.0 , -1.0 );
652
652
trans *= agg::trans_affine_scaling (1.0 , -1.0 );
653
- trans *= agg::trans_affine_translation (0.0 , (double )height);
653
+ trans *= agg::trans_affine_translation (0.5 , (double )height + 0.5 );
654
654
655
655
PathIterator marker_path (marker_path_obj);
656
656
transformed_path_t marker_path_transformed (marker_path, marker_trans);
@@ -736,8 +736,8 @@ RendererAgg::draw_markers(const Py::Tuple& args)
736
736
continue ;
737
737
}
738
738
739
- x = ( double )( int )x ;
740
- y = ( double )( int )y ;
739
+ x = floor (x) ;
740
+ y = floor (y) ;
741
741
742
742
// Cull points outside the boundary of the image.
743
743
// Values that are too large may overflow and create
@@ -772,8 +772,8 @@ RendererAgg::draw_markers(const Py::Tuple& args)
772
772
continue ;
773
773
}
774
774
775
- x = ( double )( int )x ;
776
- y = ( double )( int )y ;
775
+ x = floor (x) ;
776
+ y = floor (y) ;
777
777
778
778
// Cull points outside the boundary of the image.
779
779
// Values that are too large may overflow and create
0 commit comments