diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 9e816b2..3478c36 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -3946,7 +3946,7 @@
   /*
     Draw polygon or line.
   */
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   start=(ssize_t) ceil(bounds.y1-0.5);
   stop=(ssize_t) floor(bounds.y2+0.5);
@@ -4326,7 +4326,7 @@
     }
     case MattePrimitive:
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       switch (primitive_info->method)
       {
@@ -4522,7 +4522,7 @@
           (void) TransformImage(&composite_image,(char *) NULL,geometry,
             exception);
         }
-      if (composite_image->alpha_trait != BlendPixelTrait)
+      if (composite_image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel,
           exception);
       if (draw_info->alpha != OpaqueAlpha)