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.
This commit is contained in:
Matthias Clasen 2016-03-09 19:40:06 -05:00
parent 747962ece2
commit 0c929b7124

View File

@ -915,7 +915,7 @@ property_editor (GObject *object,
G_PARAM_SPEC_DOUBLE (spec)->minimum, G_PARAM_SPEC_DOUBLE (spec)->minimum,
G_PARAM_SPEC_DOUBLE (spec)->maximum, G_PARAM_SPEC_DOUBLE (spec)->maximum,
0.1, 0.1,
MAX ((G_PARAM_SPEC_DOUBLE (spec)->maximum - G_PARAM_SPEC_DOUBLE (spec)->minimum) / 10, 0.1), 1.0,
0.0); 0.0);
prop_edit = gtk_spin_button_new (adj, 0.1, 2); prop_edit = gtk_spin_button_new (adj, 0.1, 2);