app: fix area-based scale_limits in gimp_prop_widget_new_from_pspec()

Don't set scale limits outside the hard limits of the GParamSpec,
and remove debug g_printerr().
This commit is contained in:
Michael Natterer 2017-07-16 16:43:13 +02:00
parent d13fa3900a
commit 694fde485e
1 changed files with 6 additions and 8 deletions

View File

@ -279,21 +279,19 @@ gimp_prop_widget_new_from_pspec (GObject *config,
if (HAS_KEY (pspec, "axis", "x"))
{
g_printerr ("XXX setting width %d on %s\n",
area->width, pspec->name);
gint min = MAX (lower, off_x);
gint max = MIN (upper, off_x + area->width);
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (widget),
off_x,
off_x + area->width);
min, max);
}
else if (HAS_KEY (pspec, "axis","y"))
{
g_printerr ("XXX setting height %d on %s\n",
area->height, pspec->name);
gint min = MAX (lower, off_y);
gint max = MIN (upper, off_y + area->height);
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (widget),
off_y,
off_y + area->height);
min, max);
}
}
}