BoundingBox
bounds,
- center,
+ text_offset,
view_box;
PointInfo
{
if (LocaleCompare(keyword,"x") == 0)
{
- svg_info->bounds.x=GetUserSpaceCoordinateValue(svg_info,1,value)-
- svg_info->center.x;
+ svg_info->bounds.x=GetUserSpaceCoordinateValue(svg_info,1,value);
break;
}
if (LocaleCompare(keyword,"x1") == 0)
{
if (LocaleCompare(keyword,"y") == 0)
{
- svg_info->bounds.y=GetUserSpaceCoordinateValue(svg_info,-1,value)-
- svg_info->center.y;
+ svg_info->bounds.y=GetUserSpaceCoordinateValue(svg_info,-1,value);
break;
}
if (LocaleCompare(keyword,"y1") == 0)
{
PushGraphicContext(id);
(void) FormatLocaleFile(svg_info->file,"class \"text\"\n");
- (void) FormatLocaleFile(svg_info->file,"translate %g,%g\n",
- svg_info->bounds.x,svg_info->bounds.y);
- svg_info->center.x=svg_info->bounds.x;
- svg_info->center.y=svg_info->bounds.y;
+ svg_info->text_offset.x=svg_info->bounds.x;
+ svg_info->text_offset.y=svg_info->bounds.y;
svg_info->bounds.x=0.0;
svg_info->bounds.y=0.0;
svg_info->bounds.width=0.0;
SVGStripString(MagickTrue,svg_info->text);
text=EscapeString(svg_info->text,'\"');
(void) FormatLocaleFile(svg_info->file,"text %g,%g \"%s\"\n",
- svg_info->bounds.x-svg_info->center.x,svg_info->bounds.y-
- svg_info->center.y,text);
+ svg_info->text_offset.x,svg_info->text_offset.y,text);
text=DestroyString(text);
*svg_info->text='\0';
}
dx=GetUserSpaceCoordinateValue(svg_info,1,value);
svg_info->bounds.x+=dx;
+ svg_info->text_offset.x+=dx;
if (LocaleCompare((char *) name,"text") == 0)
(void) FormatLocaleFile(svg_info->file,"translate %g,0.0\n",dx);
break;
dy=GetUserSpaceCoordinateValue(svg_info,-1,value);
svg_info->bounds.y+=dy;
+ svg_info->text_offset.y+=dy;
if (LocaleCompare((char *) name,"text") == 0)
(void) FormatLocaleFile(svg_info->file,"translate 0.0,%g\n",dy);
break;
SVGStripString(MagickTrue,svg_info->text);
text=EscapeString(svg_info->text,'\"');
- (void) FormatLocaleFile(svg_info->file,"text 0,0 \"%s\"\n",text);
+ (void) FormatLocaleFile(svg_info->file,"text %g,%g \"%s\"\n",
+ svg_info->text_offset.x,svg_info->text_offset.y,text);
text=DestroyString(text);
*svg_info->text='\0';
- svg_info->center.x=0.0;
- svg_info->center.y=0.0;
}
(void) FormatLocaleFile(svg_info->file,"pop graphic-context\n");
break;
(void) FormatLocaleFile(svg_info->file,"class \"tspan\"\n");
text=EscapeString(svg_info->text,'\"');
(void) FormatLocaleFile(svg_info->file,"text %g,%g \"%s\"\n",
- svg_info->bounds.x-svg_info->center.x,svg_info->bounds.y-
- svg_info->center.y,text);
+ svg_info->bounds.x,svg_info->bounds.y,text);
text=DestroyString(text);
*svg_info->text='\0';
}
primitive_info[i].coordinates=0;
primitive_info[j].coordinates++;
i++;
- (void) CopyMagickString(message," <polygon points=\"",MagickPathExtent);
+ (void) CopyMagickString(message," <polygon points=\"",
+ MagickPathExtent);
(void) WriteBlobString(image,message);
length=strlen(message);
for ( ; j < i; j++)