@@ -549,8 +549,8 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
549549 agg::serialized_scanlines_adaptor_aa8 sa;
550550 agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl;
551551
552- while (path_quantized. vertex (&x, &y) != agg::path_cmd_stop ) {
553- if (has_clippath ) {
552+ if (has_clippath ) {
553+ while (path_quantized. vertex (&x, &y) != agg::path_cmd_stop ) {
554554 pixfmt_amask_type pfa (*pixFmt, *alphaMask);
555555 amask_ren_type r (pfa);
556556 amask_aa_renderer_type ren (r);
@@ -563,7 +563,9 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
563563 ren.color (gc.color );
564564 sa.init (strokeCache, strokeSize, x, y);
565565 agg::render_scanlines (sa, sl, ren);
566- } else {
566+ }
567+ } else {
568+ while (path_quantized.vertex (&x, &y) != agg::path_cmd_stop) {
567569 if (face.first ) {
568570 rendererAA->color (face.second );
569571 sa.init (fillCache, fillSize, x, y);
@@ -1139,6 +1141,7 @@ class QuadMeshGenerator {
11391141 m_iterator (0 ), m_m(m), m_n(n), m_coordinates(coordinates) {
11401142 }
11411143
1144+ private:
11421145 inline unsigned vertex (unsigned idx, double * x, double * y) {
11431146 size_t m = (idx & 0x2 ) ? (m_m + 1 ) : m_m;
11441147 size_t n = (idx+1 & 0x2 ) ? (m_n + 1 ) : m_n;
@@ -1148,8 +1151,9 @@ class QuadMeshGenerator {
11481151 return (idx) ? agg::path_cmd_line_to : agg::path_cmd_move_to;
11491152 }
11501153
1154+ public:
11511155 inline unsigned vertex (double * x, double * y) {
1152- if (m_iterator >= total_vertices ())
1156+ if (m_iterator >= total_vertices ())
11531157 return agg::path_cmd_stop;
11541158 return vertex (m_iterator++, x, y);
11551159 }
@@ -1496,7 +1500,7 @@ RendererAgg::tostring_rgba_minimized(const Py::Tuple& args) {
14961500 int ymin = height;
14971501 int xmax = 0 ;
14981502 int ymax = 0 ;
1499-
1503+
15001504 // Looks at the alpha channel to find the minimum extents of the image
15011505 unsigned char * pixel = pixBuffer + 3 ;
15021506 for (int y = 0 ; y < (int )height; ++y) {
@@ -1520,11 +1524,11 @@ RendererAgg::tostring_rgba_minimized(const Py::Tuple& args) {
15201524 ymin = std::max (0 , ymin - 1 );
15211525 xmax = std::min (xmax, (int )width);
15221526 ymax = std::min (ymax, (int )height);
1523-
1527+
15241528 newwidth = xmax - xmin;
15251529 newheight = ymax - ymin;
15261530 int newsize = newwidth * newheight * 4 ;
1527-
1531+
15281532 unsigned char * buf = new unsigned char [newsize];
15291533 unsigned int * dst = (unsigned int *)buf;
15301534 unsigned int * src = (unsigned int *)pixBuffer;
@@ -1540,7 +1544,7 @@ RendererAgg::tostring_rgba_minimized(const Py::Tuple& args) {
15401544 bounds[1 ] = Py::Int (ymin);
15411545 bounds[2 ] = Py::Int (newwidth);
15421546 bounds[3 ] = Py::Int (newheight);
1543-
1547+
15441548 Py::Tuple result (2 );
15451549 result[0 ] = data;
15461550 result[1 ] = bounds;
0 commit comments