]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sat, 28 Jul 2018 14:24:35 +0000 (10:24 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 28 Jul 2018 14:24:35 +0000 (10:24 -0400)
coders/svg.c

index 93f6fa969339b9283dc07e65454f2af379f0355b..67ec9ba78df1060ba3832953071bfd69fdda9ce8 100644 (file)
@@ -2164,13 +2164,17 @@ static void SVGStartElement(void *context,const xmlChar *name,
                         GetNextToken(p,&p,MagickPathExtent,token);
                         if (*token == ',')
                           GetNextToken(p,&p,MagickPathExtent,token);
-                        x=StringToDouble(token,&next_token)-svg_info->bounds.x;
+                        x=StringToDouble(token,&next_token);
                         GetNextToken(p,&p,MagickPathExtent,token);
                         if (*token == ',')
                           GetNextToken(p,&p,MagickPathExtent,token);
-                        y=StringToDouble(token,&next_token)-svg_info->bounds.y;
-                        affine.tx=svg_info->bounds.x+x*cos(angle)-y*sin(angle);
-                        affine.ty=svg_info->bounds.y+x*sin(angle)+y*cos(angle);
+                        y=StringToDouble(token,&next_token);
+                        affine.tx=svg_info->bounds.x+x*
+                          cos(DegreesToRadians(fmod(angle,360.0)))+y*
+                          sin(DegreesToRadians(fmod(angle,360.0)));
+                        affine.ty=svg_info->bounds.y+x*
+                          sin(DegreesToRadians(fmod(angle,360.0)))-y*
+                          cos(DegreesToRadians(fmod(angle,360.0)));
                         break;
                       }
                     break;
@@ -3025,7 +3029,6 @@ static void SVGExternalSubset(void *context,const xmlChar *name,
 static char
   SVGDensityGeometry[] = "72.0x72.0";
 
-
 static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
 {
   char