From 7426358cdb387dfd265789a728887257b9a42ff2 Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 30 May 2013 23:47:06 +0000 Subject: [PATCH] --- coders/caption.c | 12 ++++++------ coders/label.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/coders/caption.c b/coders/caption.c index 27bf68fca..7a9b07a72 100644 --- a/coders/caption.c +++ b/coders/caption.c @@ -224,7 +224,7 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, break; } high=draw_info->pointsize; - for (low=1.0; (high-low) > 1.0; ) + for (low=1.0; (high-low) > 0.5; ) { draw_info->pointsize=(low+high)/2.0; text=AcquireString(caption); @@ -242,18 +242,18 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, if ((image->columns != 0) && (image->rows != 0)) { if ((width < image->columns) && (height < image->rows)) - low=draw_info->pointsize+1.0; + low=draw_info->pointsize+0.5; else - high=draw_info->pointsize-1.0; + high=draw_info->pointsize-0.5; } else if (((image->columns != 0) && (width < image->columns)) || ((image->rows != 0) && (height < image->rows))) - low=draw_info->pointsize+1.0; + low=draw_info->pointsize+0.5; else - high=draw_info->pointsize-1.0; + high=draw_info->pointsize-0.5; } - draw_info->pointsize=(low+high)/2.0; + draw_info->pointsize=(low+high)/2.0-0.5; } (void) CloneString(&draw_info->text,caption); i=FormatMagickCaption(image,draw_info,split,&metrics,&caption,exception); diff --git a/coders/label.c b/coders/label.c index 5437019b6..2e44ee39e 100644 --- a/coders/label.c +++ b/coders/label.c @@ -168,7 +168,7 @@ static Image *ReadLABELImage(const ImageInfo *image_info, break; } high=draw_info->pointsize; - for (low=1.0; (high-low) > 1.0; ) + for (low=1.0; (high-low) > 0.5; ) { draw_info->pointsize=(low+high)/2.0; (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g", @@ -181,18 +181,18 @@ static Image *ReadLABELImage(const ImageInfo *image_info, if ((image->columns != 0) && (image->rows != 0)) { if ((width < image->columns) && (height < image->rows)) - low=draw_info->pointsize+1.0; + low=draw_info->pointsize+0.5; else - high=draw_info->pointsize-1.0; + high=draw_info->pointsize-0.5; } else if (((image->columns != 0) && (width < image->columns)) || ((image->rows != 0) && (height < image->rows))) - low=draw_info->pointsize+1.0; + low=draw_info->pointsize+0.5; else - high=draw_info->pointsize-1.0; + high=draw_info->pointsize-0.5; } - draw_info->pointsize=(low+high)/2.0; + draw_info->pointsize=(low+high)/2.0-0.5; } status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception); if (status == MagickFalse) -- 2.40.0