[gimp] app: the dissolve op now matches pixel perfectly



commit 3b043a1597111d5cf0c727873d11d445a0710cc5
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Sat Mar 31 22:31:12 2012 +0100

    app: the dissolve op now matches pixel perfectly

 app/gegl/gimpoperationdissolvemode.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/app/gegl/gimpoperationdissolvemode.c b/app/gegl/gimpoperationdissolvemode.c
index 32e03cf..9ca3ccd 100644
--- a/app/gegl/gimpoperationdissolvemode.c
+++ b/app/gegl/gimpoperationdissolvemode.c
@@ -125,24 +125,24 @@ gimp_operation_dissolve_mode_process (GeglOperation       *operation,
 
       for (x = result->x; x < result->x + result->width; x++, i++)
         {
-          gdouble  rand_val;
+          int rand_val;
           /* dissolve if random value is >= opacity */
           rand_val = g_rand_int_range (gr, 0, 255);
 
-          if (aux[3] * 255 >= rand_val)
-            {
-              out[0] = aux[0];
-              out[1] = aux[1];
-              out[2] = aux[2];
-              out[3] = 1.0;
-            }
-          else
+          if (rand_val >= aux[3] * 255)
             {
               out[0] = in[0];
               out[1] = in[1];
               out[2] = in[2];
               out[3] = in[3];
             }
+          else
+            {
+              out[0] = aux[0];
+              out[1] = aux[1];
+              out[2] = aux[2];
+              out[3] = 1.0;
+            }
 
           in+=4;
           out+=4;



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