]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 27 May 2018 22:55:03 +0000 (18:55 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 27 May 2018 22:55:03 +0000 (18:55 -0400)
MagickCore/draw.c

index acc9513cb41dc6c5e28b9af04d58048745396f44..784de9b642eb62e73f7248083fb1d4f304655aa5 100644 (file)
@@ -2790,7 +2790,8 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
               {
                 status&=QueryColorCompliance(token,AllCompliance,
                   &graphic_context[n]->fill,exception);
-                graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
+                if (graphic_context[n]->fill_alpha != OpaqueAlpha)
+                  graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
               }
             break;
           }
@@ -2808,7 +2809,8 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
             if (token == next_token)
               ThrowPointExpectedException(token,exception);
             graphic_context[n]->fill_alpha*=opacity;
-            graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
+            if (graphic_context[n]->fill_alpha != OpaqueAlpha)
+              graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
             break;
           }
         if (LocaleCompare("fill-rule",keyword) == 0)
@@ -3037,9 +3039,11 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
             if (token == next_token)
               ThrowPointExpectedException(token,exception);
             graphic_context[n]->fill_alpha*=opacity;
-            graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
+            if (graphic_context[n]->fill_alpha != OpaqueAlpha)
+              graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
             graphic_context[n]->stroke_alpha*=opacity;
-            graphic_context[n]->stroke.alpha=graphic_context[n]->stroke_alpha;
+            if (graphic_context[n]->stroke_alpha != OpaqueAlpha)
+              graphic_context[n]->stroke.alpha=graphic_context[n]->stroke_alpha;
             break;
           }
         status=MagickFalse;
@@ -3439,8 +3443,9 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
               {
                 status&=QueryColorCompliance(token,AllCompliance,
                   &graphic_context[n]->stroke,exception);
-                graphic_context[n]->stroke.alpha=
-                  graphic_context[n]->stroke_alpha;
+                if (graphic_context[n]->stroke_alpha != OpaqueAlpha)
+                  graphic_context[n]->stroke.alpha=
+                    graphic_context[n]->stroke_alpha;
                }
             break;
           }
@@ -3565,7 +3570,8 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
             if (token == next_token)
               ThrowPointExpectedException(token,exception);
             graphic_context[n]->stroke_alpha*=opacity;
-            graphic_context[n]->stroke.alpha=graphic_context[n]->stroke_alpha;
+            if (graphic_context[n]->stroke_alpha != OpaqueAlpha)
+              graphic_context[n]->stroke.alpha=graphic_context[n]->stroke_alpha;
             break;
           }
         if (LocaleCompare("stroke-width",keyword) == 0)