[gimp] app: use the GEGL properties' ui_min and ui_max for step calculation



commit 74b134d75b5f39c87e3ce0ff9df917c28232c943
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 19 23:23:32 2013 +0200

    app: use the GEGL properties' ui_min and ui_max for step calculation

 app/widgets/gimppropwidgets.c |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/app/widgets/gimppropwidgets.c b/app/widgets/gimppropwidgets.c
index 96aa9ab..05b4f38 100644
--- a/app/widgets/gimppropwidgets.c
+++ b/app/widgets/gimppropwidgets.c
@@ -515,8 +515,7 @@ gimp_prop_spin_scale_new (GObject     *config,
                                         gspec->ui_minimum, gspec->ui_maximum);
       gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (scale), gspec->ui_gamma);
     }
-
-  if (GEGL_IS_PARAM_SPEC_INT (param_spec))
+  else if (GEGL_IS_PARAM_SPEC_INT (param_spec))
     {
       GeglParamSpecInt *gspec = GEGL_PARAM_SPEC_INT (param_spec);
       gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale),
@@ -524,7 +523,6 @@ gimp_prop_spin_scale_new (GObject     *config,
       gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (scale), gspec->ui_gamma);
     }
 
-
   g_signal_connect (adjustment, "value-changed",
                     G_CALLBACK (gimp_prop_adjustment_callback),
                     config);
@@ -1605,8 +1603,25 @@ gimp_prop_table_new (GObject              *config,
           gint           digits = (G_IS_PARAM_SPEC_FLOAT (pspec) ||
                                    G_IS_PARAM_SPEC_DOUBLE (pspec)) ? 2 : 0;
 
-          get_numeric_values (config, pspec,
-                              &value, &lower, &upper, G_STRFUNC);
+          if (GEGL_IS_PARAM_SPEC_DOUBLE (pspec))
+            {
+              GeglParamSpecDouble *gspec = GEGL_PARAM_SPEC_DOUBLE (pspec);
+
+              lower = gspec->ui_minimum;
+              upper = gspec->ui_maximum;
+            }
+          else if (GEGL_IS_PARAM_SPEC_INT (pspec))
+            {
+              GeglParamSpecInt *gspec = GEGL_PARAM_SPEC_INT (pspec);
+
+              lower = gspec->ui_minimum;
+              upper = gspec->ui_maximum;
+            }
+          else
+            {
+              get_numeric_values (config, pspec,
+                                  &value, &lower, &upper, G_STRFUNC);
+            }
 
           if ((upper - lower < 10.0) &&
               (G_IS_PARAM_SPEC_FLOAT (pspec) ||


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