[gtk+] inspector: Avoid overflow when editing doubles
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Avoid overflow when editing doubles
- Date: Thu, 10 Mar 2016 03:00:02 +0000 (UTC)
commit 0c929b7124ce19a838a3acdc735533fa61d02750
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Mar 9 19:40:06 2016 -0500
inspector: Avoid overflow when editing doubles
The adjustment double properties allow values from -G_MAXDOUBLE
to G_MAXDOUBLE, which leads to overflow when calculating
max - min / 10. To avoid that, simply use a fixed page_size of 1.0.
gtk/inspector/prop-editor.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index cd855ad..2c75cc7 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -915,7 +915,7 @@ property_editor (GObject *object,
G_PARAM_SPEC_DOUBLE (spec)->minimum,
G_PARAM_SPEC_DOUBLE (spec)->maximum,
0.1,
- MAX ((G_PARAM_SPEC_DOUBLE (spec)->maximum - G_PARAM_SPEC_DOUBLE
(spec)->minimum) / 10, 0.1),
+ 1.0,
0.0);
prop_edit = gtk_spin_button_new (adj, 0.1, 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]