@@ -433,10 +433,10 @@ RendererAgg::set_clipbox(const Py::Object& cliprect, R& rasterizer)
433433 double l, b, r, t;
434434 if (py_convert_bbox (cliprect.ptr (), l, b, r, t))
435435 {
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)));
440440 }
441441 else
442442 {
@@ -650,7 +650,7 @@ RendererAgg::draw_markers(const Py::Tuple& args)
650650 // Deal with the difference in y-axis direction
651651 marker_trans *= agg::trans_affine_scaling (1.0 , -1.0 );
652652 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 );
654654
655655 PathIterator marker_path (marker_path_obj);
656656 transformed_path_t marker_path_transformed (marker_path, marker_trans);
@@ -736,8 +736,8 @@ RendererAgg::draw_markers(const Py::Tuple& args)
736736 continue ;
737737 }
738738
739- x = ( double )( int )x ;
740- y = ( double )( int )y ;
739+ x = floor (x) ;
740+ y = floor (y) ;
741741
742742 // Cull points outside the boundary of the image.
743743 // Values that are too large may overflow and create
@@ -772,8 +772,8 @@ RendererAgg::draw_markers(const Py::Tuple& args)
772772 continue ;
773773 }
774774
775- x = ( double )( int )x ;
776- y = ( double )( int )y ;
775+ x = floor (x) ;
776+ y = floor (y) ;
777777
778778 // Cull points outside the boundary of the image.
779779 // Values that are too large may overflow and create
0 commit comments