This commit is contained in:
Cristy
2021-10-02 06:41:45 -04:00
parent bafbac2ace
commit 8dbdb9866e
2 changed files with 23 additions and 21 deletions
+11 -10
View File
@@ -91,19 +91,20 @@
% o exception: return any errors or warnings in this structure.
%
*/
static inline void AdjustTypeMetricBounds(TypeMetric *metrics)
{
if (metrics->bounds.x1 < 0.0)
{
double
new_x1;
double
x1;
new_x1=ceil(-metrics->bounds.x1+0.5);
metrics->width+=new_x1+new_x1;
metrics->bounds.x1=new_x1;
if (metrics->bounds.x1 >= 0.0)
{
metrics->bounds.x1=0.0;
return;
}
else
metrics->bounds.x1=0.0;
x1=ceil(-metrics->bounds.x1+0.5);
metrics->width+=x1+x1;
metrics->bounds.x1=x1;
}
static Image *ReadCAPTIONImage(const ImageInfo *image_info,
@@ -325,7 +326,7 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
Draw caption.
*/
i=FormatMagickCaption(image,draw_info,split,&metrics,&caption,exception);
AdjustTypeMetricBounds(&metrics);
AdjustTypeMetricBounds(&metrics);
(void) CloneString(&draw_info->text,caption);
caption=DestroyString(caption);
(void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",
+12 -11
View File
@@ -87,19 +87,20 @@
% o exception: return any errors or warnings in this structure.
%
*/
static inline void AdjustTypeMetricBounds(TypeMetric *metrics)
{
if (metrics->bounds.x1 < 0.0)
{
double
new_x1;
double
x1;
new_x1=ceil(-metrics->bounds.x1+0.5);
metrics->width+=new_x1+new_x1;
metrics->bounds.x1=new_x1;
if (metrics->bounds.x1 >= 0.0)
{
metrics->bounds.x1=0.0;
return;
}
else
metrics->bounds.x1=0.0;
x1=ceil(-metrics->bounds.x1+0.5);
metrics->width+=x1+x1;
metrics->bounds.x1=x1;
}
static Image *ReadLABELImage(const ImageInfo *image_info,
@@ -279,8 +280,8 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
*/
(void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",
(draw_info->direction == RightToLeftDirection ? (double) image->columns-
metrics.bounds.x2 : metrics.bounds.x1),(draw_info->gravity == UndefinedGravity ?
MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0));
metrics.bounds.x2 : metrics.bounds.x1),(draw_info->gravity ==
UndefinedGravity ? MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0));
(void) CloneString(&draw_info->geometry,geometry);
status=AnnotateImage(image,draw_info,exception);
if (image_info->pointsize == 0.0)