[gimp/gimp-2-8] Bug 745126 - gimp_preview_area_blend() fails for RGBA image...



commit 677ccd4246578dda416bcced3555ec36273be0ff
Author: Michael Natterer <mitch gimp org>
Date:   Fri Feb 27 09:50:34 2015 +0100

    Bug 745126 - gimp_preview_area_blend() fails for RGBA image...
    
    ...if buf1 and buf2 have same alpha value
    
    Fix a misplaced } that was causing the final write to the destination
    buffer to be executed only for the case where the alphas are
    different. Thanks to Jonathan Tait.
    
    (cherry picked from commit 36548fd1ad79a8e6c84d84615ab303d95610899f)

 libgimpwidgets/gimppreviewarea.c |   46 +++++++++++++++++++-------------------
 1 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/libgimpwidgets/gimppreviewarea.c b/libgimpwidgets/gimppreviewarea.c
index bc60563..159e0b5 100644
--- a/libgimpwidgets/gimppreviewarea.c
+++ b/libgimpwidgets/gimppreviewarea.c
@@ -747,30 +747,30 @@ gimp_preview_area_blend (GimpPreviewArea *area,
                             (((a << 8) + (b  - a) * opacity) >> 8) / inter[3];
                         }
                     }
+                }
 
-                  switch (inter[3])
-                    {
-                    case 0:
-                      d[0] = d[1] = d[2] = CHECK_COLOR (area, row, col);
-                      break;
+              switch (inter[3])
+                {
+                case 0:
+                  d[0] = d[1] = d[2] = CHECK_COLOR (area, row, col);
+                  break;
 
-                    case 255:
-                      d[0] = inter[0];
-                      d[1] = inter[1];
-                      d[2] = inter[2];
-                      break;
+                case 255:
+                  d[0] = inter[0];
+                  d[1] = inter[1];
+                  d[2] = inter[2];
+                  break;
 
-                    default:
-                      {
-                        register guint alpha = inter[3] + 1;
-                        register guint check = CHECK_COLOR (area, row, col);
+                default:
+                  {
+                    register guint alpha = inter[3] + 1;
+                    register guint check = CHECK_COLOR (area, row, col);
 
-                        d[0] = ((check << 8) + (inter[0] - check) * alpha) >> 8;
-                        d[1] = ((check << 8) + (inter[1] - check) * alpha) >> 8;
-                        d[2] = ((check << 8) + (inter[2] - check) * alpha) >> 8;
-                      }
-                      break;
-                    }
+                    d[0] = ((check << 8) + (inter[0] - check) * alpha) >> 8;
+                    d[1] = ((check << 8) + (inter[1] - check) * alpha) >> 8;
+                    d[2] = ((check << 8) + (inter[2] - check) * alpha) >> 8;
+                  }
+                  break;
                 }
             }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]