gimp r26749 - trunk/app/paint-funcs



Author: neo
Date: Mon Aug 25 07:10:14 2008
New Revision: 26749
URL: http://svn.gnome.org/viewvc/gimp?rev=26749&view=rev

Log:
another small cleanup


Modified:
   trunk/app/paint-funcs/scale-region.c

Modified: trunk/app/paint-funcs/scale-region.c
==============================================================================
--- trunk/app/paint-funcs/scale-region.c	(original)
+++ trunk/app/paint-funcs/scale-region.c	Mon Aug 25 07:10:14 2008
@@ -1616,14 +1616,11 @@
   gint        b;
   gdouble     sum, alphasum;
 
-  for (b = 0; b < bytes; b++)
-    pixel[b] = 0;
-
   switch (bytes)
     {
     case 1:
-      sum      = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
-      pixel[0]     = (guchar) CLAMP (sum, 0, 255);
+      sum = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
+      pixel[0] = (guchar) CLAMP (sum, 0, 255);
       break;
 
     case 2:
@@ -1636,6 +1633,10 @@
           pixel[0] = (guchar) CLAMP (sum, 0, 255);
           pixel[1] = (guchar) CLAMP (alphasum, 0, 255);
         }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
+        }
       break;
 
     case 3:
@@ -1660,6 +1661,10 @@
 
           pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
         }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
+        }
       break;
     }
 }



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