[gimp/goat-invasion: 342/526] app: handle negative fractions correctly in spinscale



commit c5d2128951249bef7f77a6cd6be118fc1fda384a
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Sat Mar 31 00:50:51 2012 +0100

    app: handle negative fractions correctly in spinscale

 app/widgets/gimpspinscale.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimpspinscale.c b/app/widgets/gimpspinscale.c
index 445763c..245d4de 100644
--- a/app/widgets/gimpspinscale.c
+++ b/app/widgets/gimpspinscale.c
@@ -464,7 +464,8 @@ gimp_spin_scale_change_value (GtkWidget *widget,
       gdouble fraction;
 
       fraction = x / (gdouble) width;
-      fraction = pow (fraction, private->gamma);
+      if (fraction > 0.0)
+        fraction = pow (fraction, private->gamma);
 
       value = fraction * (upper - lower) + lower;
     }



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