]> git.saurik.com Git - wxWidgets.git/commitdiff
check for alpha first, then mask, in BlurHorizontal/Vertical(): not only this makes...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 15:49:08 +0000 (15:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 15:49:08 +0000 (15:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/image.cpp

index be43304ba96464fd14a550bdf7d67056c8526570..8d341247276000e8ce764befca84c300c4343259 100644 (file)
@@ -754,20 +754,17 @@ wxImage wxImage::BlurHorizontal(int blurRadius)
     unsigned char* dst_alpha = NULL;
 
     // Check for a mask or alpha
-    if ( M_IMGDATA->m_hasMask )
+    if ( src_alpha )
+    {
+        ret_image.SetAlpha();
+        dst_alpha = ret_image.GetAlpha();
+    }
+    else if ( M_IMGDATA->m_hasMask )
     {
         ret_image.SetMaskColour(M_IMGDATA->m_maskRed,
                                 M_IMGDATA->m_maskGreen,
                                 M_IMGDATA->m_maskBlue);
     }
-    else
-    {
-        if ( src_alpha )
-        {
-            ret_image.SetAlpha();
-            dst_alpha = ret_image.GetAlpha();
-        }
-    }
 
     // number of pixels we average over
     const int blurArea = blurRadius*2 + 1;
@@ -872,20 +869,17 @@ wxImage wxImage::BlurVertical(int blurRadius)
     unsigned char* dst_alpha = NULL;
 
     // Check for a mask or alpha
-    if ( M_IMGDATA->m_hasMask )
+    if ( src_alpha )
+    {
+        ret_image.SetAlpha();
+        dst_alpha = ret_image.GetAlpha();
+    }
+    else if ( M_IMGDATA->m_hasMask )
     {
         ret_image.SetMaskColour(M_IMGDATA->m_maskRed,
                                 M_IMGDATA->m_maskGreen,
                                 M_IMGDATA->m_maskBlue);
     }
-    else
-    {
-        if ( src_alpha )
-        {
-            ret_image.SetAlpha();
-            dst_alpha = ret_image.GetAlpha();
-        }
-    }
 
     // number of pixels we average over
     const int blurArea = blurRadius*2 + 1;