]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1203
authorCristy <urban-warrior@imagemagick.org>
Wed, 11 Jul 2018 23:59:44 +0000 (19:59 -0400)
committerCristy <urban-warrior@imagemagick.org>
Wed, 11 Jul 2018 23:59:44 +0000 (19:59 -0400)
MagickCore/property.c

index 82cb1e5778d372ea25075e1f90382584e8e84a90..92433c9afb1f7dd6ca6b8c5e49c507eff0cb2d67 100644 (file)
@@ -2182,14 +2182,14 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
               Handle special cases when Bezier curves are used to describe
               corners and straight lines.
             */
-            if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
+            if (((last[1].x == last[2].x) || (last[1].y == last[2].y)) &&
                 (point[0].x == point[1].x) && (point[0].y == point[1].y))
               (void) FormatLocaleString(message,MagickPathExtent,
                 "L %g %g\n",point[1].x,point[1].y);
             else
               (void) FormatLocaleString(message,MagickPathExtent,
-                "C %g %g %g %g %g %g\n",last[2].x,
-                last[2].y,point[0].x,point[0].y,point[1].x,point[1].y);
+                "C %g %g %g %g %g %g\n",last[2].x,last[2].y,point[0].x,
+                point[0].y,point[1].x,point[1].y);
             for (i=0; i < 3; i++)
               last[i]=point[i];
           }
@@ -2205,14 +2205,14 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
               Same special handling as above except we compare to the
               first point in the path and close the path.
             */
-            if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
+            if (((last[1].x == last[2].x) || (last[1].y == last[2].y)) &&
                 (first[0].x == first[1].x) && (first[0].y == first[1].y))
               (void) FormatLocaleString(message,MagickPathExtent,
                 "L %g %g Z\n",first[1].x,first[1].y);
             else
               (void) FormatLocaleString(message,MagickPathExtent,
-                "C %g %g %g %g %g %g Z\n",last[2].x,
-                last[2].y,first[0].x,first[0].y,first[1].x,first[1].y);
+                "C %g %g %g %g %g %g Z\n",last[2].x,last[2].y,first[0].x,
+                first[0].y,first[1].x,first[1].y);
             (void) ConcatenateString(&path,message);
             in_subpath=MagickFalse;
           }