]> granicus.if.org Git - imagemagick/commitdiff
Partial fix to https://github.com/ImageMagick/ImageMagick/issues/167
authorCristy <urban-warrior@imagemagick.org>
Sat, 9 Jul 2016 00:28:28 +0000 (20:28 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 9 Jul 2016 00:28:28 +0000 (20:28 -0400)
MagickCore/draw.c

index 2438734c268557b73962f968cd9c3ee5f0d64ad0..8fa2d93efdb07efa187b0de1df86b073f0e50259 100644 (file)
@@ -2030,8 +2030,13 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
                 &graphic_context[n]->fill_pattern,exception);
             else
               {
+                Quantum
+                  alpha;
+
+                alpha=graphic_context[n]->fill.alpha;
                 status&=QueryColorCompliance(token,AllCompliance,
                   &graphic_context[n]->fill,exception);
+                graphic_context[n]->fill.alpha=alpha;
                 if (status == MagickFalse)
                   {
                     ImageInfo
@@ -2233,8 +2238,8 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
           {
             GetNextToken(q,&q,extent,token);
             factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
-            graphic_context[n]->alpha=ClampToQuantum(QuantumRange*(1.0-((1.0-
-              QuantumScale*graphic_context[n]->alpha)*factor*
+            graphic_context[n]->alpha=ClampToQuantum(QuantumRange*(1.0-(
+              QuantumScale*graphic_context[n]->alpha*factor*
               StringToDouble(token,&next_token))));
             if (token == next_token)
               status=MagickFalse;
@@ -2590,8 +2595,13 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
                 &graphic_context[n]->stroke_pattern,exception);
             else
               {
+                Quantum
+                  alpha;
+
+                alpha=graphic_context[n]->stroke.alpha;
                 status&=QueryColorCompliance(token,AllCompliance,
                   &graphic_context[n]->stroke,exception);
+                graphic_context[n]->stroke.alpha=alpha;
                 if (status == MagickFalse)
                   {
                     ImageInfo