[gimp] app: argh, so much for less stupid
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: argh, so much for less stupid
- Date: Thu, 19 Jun 2014 17:02:54 +0000 (UTC)
commit 40cbbf8faf5f1c8c20ab5597f8f2308549f6b5c8
Author: Michael Natterer <mitch gimp org>
Date: Thu Jun 19 19:00:23 2014 +0200
app: argh, so much for less stupid
app/widgets/gimpspinscale.c | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/app/widgets/gimpspinscale.c b/app/widgets/gimpspinscale.c
index c1a90ca..e2b7cf7 100644
--- a/app/widgets/gimpspinscale.c
+++ b/app/widgets/gimpspinscale.c
@@ -588,6 +588,7 @@ gimp_spin_scale_change_value (GtkWidget *widget,
gint width;
gdouble value;
gint digits;
+ gint power = 1;
gimp_spin_scale_get_limits (GIMP_SPIN_SCALE (widget), &lower, &upper);
@@ -622,22 +623,16 @@ gimp_spin_scale_change_value (GtkWidget *widget,
}
digits = gtk_spin_button_get_digits (spin_button);
-
- if (digits > 0)
- {
- gint power = 1;
-
- while (digits--)
- power *= 10;
-
- /* round the value to the possible precision of the spinbutton, so
- * a focus-out will not change the value again, causing inadvertend
- * adjustment signals.
- */
- value *= power;
- value = RINT (value);
- value /= power;
- }
+ while (digits--)
+ power *= 10;
+
+ /* round the value to the possible precision of the spinbutton, so
+ * a focus-out will not change the value again, causing inadvertend
+ * adjustment signals.
+ */
+ value *= power;
+ value = RINT (value);
+ value /= power;
gtk_adjustment_set_value (adjustment, value);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]