]> granicus.if.org Git - imagemagick/commitdiff
Fixed fill-rule in SVG clip path.
authordirk <dirk@git.imagemagick.org>
Sat, 19 Jul 2014 09:26:27 +0000 (09:26 +0000)
committerdirk <dirk@git.imagemagick.org>
Sat, 19 Jul 2014 09:26:27 +0000 (09:26 +0000)
MagickCore/property.c

index c64df67c79b364b693ceb578b768256baabccef5..14d08e37a268d307e7348cfa37455d146e96220a 100644 (file)
@@ -1941,19 +1941,14 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
   if (path == (char *) NULL)
     return((char *) NULL);
   message=AcquireString((char *) NULL);
-  (void) FormatLocaleString(message,MaxTextExtent,
-    "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
-  (void) ConcatenateString(&path,message);
-  (void) FormatLocaleString(message,MaxTextExtent,
-    "<svg width=\"%.20g\" height=\"%.20g\">\n",(double) columns,(double) rows);
-  (void) ConcatenateString(&path,message);
-  (void) FormatLocaleString(message,MaxTextExtent,"<g>\n");
-  (void) ConcatenateString(&path,message);
-  (void) FormatLocaleString(message,MaxTextExtent,
-    "<path style=\"fill:#00000000;stroke:#00000000;");
-  (void) ConcatenateString(&path,message);
-  (void) FormatLocaleString(message,MaxTextExtent,
-    "stroke-width:0;stroke-antialiasing:false\" d=\"\n");
+    (void) FormatLocaleString(message,MaxTextExtent,
+    ("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
+    "<svg xmlns=\"http://www.w3.org/2000/svg\""
+    " width=\"%.20g\" height=\"%.20g\">\n"
+    "<g>\n"
+    "<path fill-rule=\"evenodd\" style=\"fill:#00000000;stroke:#00000000;"
+    "stroke-width:0;stroke-antialiasing:false\" d=\"\n"),
+    (double) columns,(double) rows);
   (void) ConcatenateString(&path,message);
   (void) ResetMagickMemory(point,0,sizeof(point));
   (void) ResetMagickMemory(first,0,sizeof(first));
@@ -2102,12 +2097,7 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
   /*
     Return an empty SVG image if the path does not have knots.
   */
-  (void) FormatLocaleString(message,MaxTextExtent,"\"/>\n");
-  (void) ConcatenateString(&path,message);
-  (void) FormatLocaleString(message,MaxTextExtent,"</g>\n");
-  (void) ConcatenateString(&path,message);
-  (void) FormatLocaleString(message,MaxTextExtent,"</svg>\n");
-  (void) ConcatenateString(&path,message);
+  (void) ConcatenateString(&path,"\"/>\n</g>\n</svg>\n");
   message=DestroyString(message);
   return(path);
 }