SetGeometryInfo(&geometry_info);
flags=ParseGeometry(arg1,&geometry_info);
- if ((flags & RhoValue) == 0)
+ if (flags == 0)
CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=geometry_info.rho;
/*
Auto fit text into bounding box.
*/
- for ( ; ; )
+ for ( ; ; draw_info->pointsize*=2.0)
{
text=AcquireString(caption);
i=FormatMagickCaption(image,draw_info,MagickTrue,&metrics,&text,
height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
if ((width > image->columns) && (height > image->rows))
break;
- draw_info->pointsize*=2.0;
}
high=draw_info->pointsize/2.0;
- low=high/2.0;
- while ((high-low) > 1.0)
+ for (low=high/2.0; (high-low) > 1.0; )
{
draw_info->pointsize=(low+high)/2.0;
text=AcquireString(caption);
else
high=draw_info->pointsize-1.0;
}
- for (draw_info->pointsize=(low+high)/2.0; (high-low) > 1.0; )
+ for (draw_info->pointsize=(low+high)/2.0; ; draw_info->pointsize--)
{
text=AcquireString(caption);
i=FormatMagickCaption(image,draw_info,MagickTrue,&metrics,&text,
height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
if ((width <= image->columns) && (height <= image->rows))
break;
- draw_info->pointsize--;
}
draw_info->pointsize=floor(draw_info->pointsize);
}
(void) ParseAbsoluteGeometry(image_info->page,&page);
if (image->columns == 0)
{
- pango_layout_get_pixel_extents(layout,NULL,&extent);
+ pango_layout_get_extents(layout,NULL,&extent);
image->columns=(extent.x+extent.width+PANGO_SCALE/2)/PANGO_SCALE+2*page.x;
}
else
}
if (image->rows == 0)
{
- pango_layout_get_pixel_extents(layout,NULL,&extent);
+ pango_layout_get_extents(layout,NULL,&extent);
image->rows=(extent.y+extent.height+PANGO_SCALE/2)/PANGO_SCALE+2*page.y;
}
else