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:
Ondřej Míchal 2026-01-07 16:03:18 +02:00
parent 04af22eef1
commit e735054347

View file

@ -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)