[gimp] app: eliminate unnecessary condition in GimpOperationReplaceMode



commit e17f640fba2777d9716eefbd9cb51614901483ab
Author: Ell <ell_se yahoo com>
Date:   Wed Jan 11 08:18:29 2017 -0500

    app: eliminate unnecessary condition in GimpOperationReplaceMode
    
    8-bit relic.

 app/operations/layer-modes/gimpoperationreplace.c |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpoperationreplace.c 
b/app/operations/layer-modes/gimpoperationreplace.c
index 122d647..93c895b 100644
--- a/app/operations/layer-modes/gimpoperationreplace.c
+++ b/app/operations/layer-modes/gimpoperationreplace.c
@@ -106,20 +106,7 @@ gimp_operation_replace_process_pixels (gfloat              *in,
           gfloat ratio = opacity_value * layer[ALPHA] / new_alpha;
 
           for (b = RED; b < ALPHA; b++)
-            {
-              gfloat t;
-
-              if (layer[b] > in[b])
-                {
-                  t = (layer[b] - in[b]) * ratio;
-                  out[b] = in[b] + t;
-                }
-              else
-                {
-                  t = (in[b] - layer[b]) * ratio;
-                  out[b] = in[b] - t;
-                }
-            }
+            out[b] = (layer[b] - in[b]) * ratio + in[b];
         }
       else
         {


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