libgimp: Handle integer properties bound to GimpSpinScale in procedure dialogs
Setting a step/page size of less than one for a spin scale bound to an integer property does not make sense. Similarly the number of decimal digits shown can be set to 0.
This commit is contained in:
parent
04af22eef1
commit
e735054347
1 changed files with 8 additions and 0 deletions
|
|
@ -1511,6 +1511,14 @@ gimp_procedure_dialog_get_spin_scale (GimpProcedureDialog *dialog,
|
|||
}
|
||||
gimp_range_estimate_settings (minimum * factor, maximum * factor, &step, &page, &digits);
|
||||
|
||||
if (G_PARAM_SPEC_TYPE (pspec) == G_TYPE_PARAM_UINT ||
|
||||
G_PARAM_SPEC_TYPE (pspec) == G_TYPE_PARAM_INT)
|
||||
{
|
||||
digits = 0;
|
||||
step = MAX(step, 1.f);
|
||||
page = MAX(page, step);
|
||||
}
|
||||
|
||||
widget = gimp_prop_spin_scale_new (G_OBJECT (priv->config),
|
||||
property, step, page, digits);
|
||||
if (G_PARAM_SPEC_TYPE (pspec) == G_TYPE_PARAM_DOUBLE)
|
||||
|
|
|
|||
Loading…
Reference in a new issue