From: cristy Date: Thu, 1 Dec 2011 15:56:42 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6595 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59ee19d213518833ce9a48984d808b3b80c0e86b;p=imagemagick --- diff --git a/coders/svg.c b/coders/svg.c index 9d72fbb50..c505ee85b 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -2166,7 +2166,9 @@ static void SVGStartElement(void *context,const xmlChar *name, { double sx, - sy; + sy, + tx, + ty; if ((svg_info->view_box.width == 0.0) || (svg_info->view_box.height == 0.0)) @@ -2177,8 +2179,12 @@ static void SVGStartElement(void *context,const xmlChar *name, (double) svg_info->width,(double) svg_info->height); sx=(double) svg_info->width/svg_info->view_box.width; sy=(double) svg_info->height/svg_info->view_box.height; - (void) FormatLocaleFile(svg_info->file,"affine %g 0 0 %g 0.0 0.0\n", - sx,sy); + tx=svg_info->view_box.x != 0.0 ? (double) -sx*svg_info->view_box.x : + 0.0; + ty=svg_info->view_box.y != 0.0 ? (double) -sy*svg_info->view_box.y : + 0.0; + (void) FormatLocaleFile(svg_info->file,"affine %g 0 0 %g %g %g\n", + sx,sy,tx,ty); } } (void) LogMagickEvent(CoderEvent,GetMagickModule()," )");