@@ -715,6 +715,7 @@ RendererAgg::draw_markers(const Py::Tuple& args)
715715 theRasterizer.reset ();
716716 theRasterizer.reset_clipping ();
717717 rendererBase.reset_clipping (true );
718+ agg::rect_i marker_size (0x7FFFFFFF , 0x7FFFFFFF , -0x7FFFFFFF , -0x7FFFFFFF );
718719
719720 agg::int8u staticFillCache[MARKER_CACHE_SIZE];
720721 agg::int8u staticStrokeCache[MARKER_CACHE_SIZE];
@@ -738,6 +739,8 @@ RendererAgg::draw_markers(const Py::Tuple& args)
738739 fillCache = new agg::int8u[fillSize];
739740 }
740741 scanlines.serialize (fillCache);
742+ marker_size = agg::rect_i (scanlines.min_x (), scanlines.min_y (),
743+ scanlines.max_x (), scanlines.max_y ());
741744 }
742745
743746 stroke_t stroke (marker_path_curve);
@@ -757,6 +760,10 @@ RendererAgg::draw_markers(const Py::Tuple& args)
757760 strokeCache = new agg::int8u[strokeSize];
758761 }
759762 scanlines.serialize (strokeCache);
763+ marker_size = agg::rect_i (std::min (marker_size.x1 , scanlines.min_x ()),
764+ std::min (marker_size.y1 , scanlines.min_y ()),
765+ std::max (marker_size.x2 , scanlines.max_x ()),
766+ std::max (marker_size.y2 , scanlines.max_y ()));
760767
761768 theRasterizer.reset_clipping ();
762769 rendererBase.reset_clipping (true );
@@ -769,10 +776,10 @@ RendererAgg::draw_markers(const Py::Tuple& args)
769776 agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl;
770777
771778 agg::rect_d clipping_rect (
772- -1.0 - scanlines. max_x () ,
773- -1.0 - scanlines. max_y () ,
774- 1.0 + width - scanlines. min_x () ,
775- 1.0 + height - scanlines. min_y () );
779+ -1.0 - marker_size. x2 ,
780+ -1.0 - marker_size. y2 ,
781+ 1.0 + width - marker_size. x1 ,
782+ 1.0 + height - marker_size. y1 );
776783
777784 if (has_clippath)
778785 {
0 commit comments