]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 27 May 2018 21:28:19 +0000 (17:28 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 27 May 2018 21:28:19 +0000 (17:28 -0400)
MagickCore/draw-private.h
MagickCore/draw.c

index 2647a2db12a3cd8070d5803819d5798a1eac20ed..41fb1b522b0d8f7a65c24fa03c7047674b376710 100644 (file)
@@ -32,8 +32,6 @@ static inline void GetFillColor(const DrawInfo *draw_info,const ssize_t x,
   if (draw_info->fill_pattern == (Image *) NULL)
     {
       *fill=draw_info->fill;
-      if (fabs(draw_info->fill_alpha-TransparentAlpha) >= MagickEpsilon)
-        fill->alpha*=QuantumScale*draw_info->fill_alpha;
       return;
     }
   {
@@ -54,8 +52,6 @@ static inline void GetStrokeColor(const DrawInfo *draw_info,const ssize_t x,
   if (draw_info->stroke_pattern == (Image *) NULL)
     {
       *stroke=draw_info->stroke;
-      if (fabs(draw_info->stroke_alpha-TransparentAlpha) >= MagickEpsilon)
-        stroke->alpha*=QuantumScale*draw_info->stroke_alpha;
       return;
     }
   {
index c66c59e38a67d2ba6685ca2781b589506926b850..78086dceca5b23ed184ab8a068f99fb4d7484c4d 100644 (file)
@@ -2787,8 +2787,11 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
               (void) DrawPatternPath(image,draw_info,token,
                 &graphic_context[n]->fill_pattern,exception);
             else
-              status&=QueryColorCompliance(token,AllCompliance,
-                &graphic_context[n]->fill,exception);
+              {
+                status&=QueryColorCompliance(token,AllCompliance,
+                  &graphic_context[n]->fill,exception);
+                graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
+              }
             break;
           }
         if (LocaleCompare("fill-opacity",keyword) == 0)
@@ -2804,8 +2807,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
               StringToDouble(token,&next_token),0.0),1.0);
             if (token == next_token)
               ThrowPointExpectedException(token,exception);
-            if (fabs(opacity) >= DrawEpsilon)
-              graphic_context[n]->fill_alpha*=opacity;
+            graphic_context[n]->fill_alpha*=opacity;
             break;
           }
         if (LocaleCompare("fill-rule",keyword) == 0)
@@ -3434,8 +3436,12 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
               (void) DrawPatternPath(image,draw_info,token,
                 &graphic_context[n]->stroke_pattern,exception);
             else
-              status&=QueryColorCompliance(token,AllCompliance,
-                &graphic_context[n]->stroke,exception);
+              {
+                status&=QueryColorCompliance(token,AllCompliance,
+                  &graphic_context[n]->stroke,exception);
+                graphic_context[n]->stroke.alpha=
+                  graphic_context[n]->stroke_alpha;
+              }
             break;
           }
         if (LocaleCompare("stroke-antialias",keyword) == 0)
@@ -3558,8 +3564,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
               StringToDouble(token,&next_token),0.0),1.0);
             if (token == next_token)
               ThrowPointExpectedException(token,exception);
-            if (fabs(opacity) >= DrawEpsilon)
-              graphic_context[n]->stroke_alpha*=opacity;
+            graphic_context[n]->stroke_alpha*=opacity;
             break;
           }
         if (LocaleCompare("stroke-width",keyword) == 0)
@@ -6602,12 +6607,14 @@ static void TraceRectangle(PrimitiveInfo *primitive_info,const PointInfo start,
   TracePoint(p,start);
   p+=p->coordinates;
   point.x=start.x;
-  point.y=end.y;
+  point.y=end.y-1.0;
   TracePoint(p,point);
   p+=p->coordinates;
-  TracePoint(p,end);
+  point.x=end.x-1.0;
+  point.y=end.y-1.0;
+  TracePoint(p,point);
   p+=p->coordinates;
-  point.x=end.x;
+  point.x=end.x-1.0;
   point.y=start.y;
   TracePoint(p,point);
   p+=p->coordinates;