@@ -528,6 +528,7 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
528528 theRasterizer.reset ();
529529 theRasterizer.reset_clipping ();
530530 rendererBase.reset_clipping (true );
531+ agg::rect_i marker_size (0x7FFFFFFF , 0x7FFFFFFF , -0x7FFFFFFF , -0x7FFFFFFF );
531532
532533 agg::int8u staticFillCache[MARKER_CACHE_SIZE];
533534 agg::int8u staticStrokeCache[MARKER_CACHE_SIZE];
@@ -545,6 +546,10 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
545546 fillCache = new agg::int8u[fillSize];
546547 }
547548 scanlines.serialize (fillCache);
549+ marker_size = agg::rect_i (scanlines.min_x (),
550+ scanlines.min_y (),
551+ scanlines.max_x (),
552+ scanlines.max_y ());
548553 }
549554
550555 stroke_t stroke (marker_path_curve);
@@ -559,6 +564,10 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
559564 strokeCache = new agg::int8u[strokeSize];
560565 }
561566 scanlines.serialize (strokeCache);
567+ marker_size = agg::rect_i (std::min (marker_size.x1 , scanlines.min_x ()),
568+ std::min (marker_size.y1 , scanlines.min_y ()),
569+ std::max (marker_size.x2 , scanlines.max_x ()),
570+ std::max (marker_size.y2 , scanlines.max_y ()));
562571
563572 theRasterizer.reset_clipping ();
564573 rendererBase.reset_clipping (true );
@@ -570,10 +579,10 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
570579 agg::serialized_scanlines_adaptor_aa8 sa;
571580 agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl;
572581
573- agg::rect_d clipping_rect (-1.0 - scanlines. max_x () ,
574- -1.0 - scanlines. max_y () ,
575- 1.0 + width - scanlines. min_x () ,
576- 1.0 + height - scanlines. min_y () );
582+ agg::rect_d clipping_rect (-1.0 - marker_size. x2 ,
583+ -1.0 - marker_size. y2 ,
584+ 1.0 + width - marker_size. x1 ,
585+ 1.0 + height - marker_size. y1 );
577586
578587 if (has_clippath) {
579588 while (path_curve.vertex (&x, &y) != agg::path_cmd_stop) {
0 commit comments