]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Fri, 16 Feb 2018 13:20:31 +0000 (08:20 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 16 Feb 2018 13:20:31 +0000 (08:20 -0500)
MagickCore/draw.c

index cd48710e181721bc870e8082d917f2396f0fe695..32b0aa6fc11fe4dc1b5a631c0f4d32f1a2cb3208 100644 (file)
@@ -5549,7 +5549,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           arc;
 
         /*
-          Compute arc points.
+          Elliptical arc.
         */
         do
         {
@@ -5597,7 +5597,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
       case 'C':
       {
         /*
-          Compute bezier points.
+          Cubic Bézier curve.
         */
         do
         {
@@ -5621,6 +5621,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           TraceBezier(q,4);
           q+=q->coordinates;
           point=end;
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
@@ -5636,12 +5640,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           point.x=(double) (attribute == (int) 'H' ? x: point.x+x);
           TracePoint(q,point);
           q+=q->coordinates;
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
       case 'l':
       case 'L':
       {
+        /*
+          Line to.
+        */
         do
         {
           GetNextToken(p,&p,MagickPathExtent,token);
@@ -5656,12 +5667,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           point.y=(double) (attribute == (int) 'L' ? y : point.y+y);
           TracePoint(q,point);
           q+=q->coordinates;
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
       case 'M':
       case 'm':
       {
+        /*
+          Move to;
+        */
         if (q != primitive_info)
           {
             primitive_info->coordinates=(size_t) (q-primitive_info);
@@ -5691,6 +5709,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
               TracePoint(q,point);
               q+=q->coordinates;
             }
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
@@ -5698,7 +5720,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
       case 'Q':
       {
         /*
-          Compute bezier points.
+          Quadratic Bézier curve.
         */
         do
         {
@@ -5724,6 +5746,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           TraceBezier(q,3);
           q+=q->coordinates;
           point=end;
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
@@ -5731,7 +5757,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
       case 'S':
       {
         /*
-          Compute bezier points.
+          Cubic Bézier curve.
         */
         do
         {
@@ -5764,6 +5790,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           TraceBezier(q,4);
           q+=q->coordinates;
           point=end;
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
@@ -5771,7 +5801,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
       case 'T':
       {
         /*
-          Compute bezier points.
+          Quadratic Bézier curve.
         */
         do
         {
@@ -5802,12 +5832,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           TraceBezier(q,3);
           q+=q->coordinates;
           point=end;
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
       case 'v':
       case 'V':
       {
+        /*
+          Line to.
+        */
         do
         {
           GetNextToken(p,&p,MagickPathExtent,token);
@@ -5817,12 +5854,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
           point.y=(double) (attribute == (int) 'V' ? y : point.y+y);
           TracePoint(q,point);
           q+=q->coordinates;
+          while (isspace((int) ((unsigned char) *p)) != 0)
+            p++;
+          if (*p == ',')
+            p++;
         } while (IsPoint(p) != MagickFalse);
         break;
       }
       case 'z':
       case 'Z':
       {
+        /*
+          Close path.
+        */
         point=start;
         TracePoint(q,point);
         q+=q->coordinates;