forked from AuroraMiddleware/gtk
range: avoid setting slider coordinates to negative numbers
This can happen if the theme sets a negative margin, but the coordinate should never be negative.
This commit is contained in:
parent
fce344d31f
commit
f3e068bb31
@ -2617,13 +2617,13 @@ update_initial_slider_position (GtkRange *range,
|
||||
|
||||
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
{
|
||||
priv->slide_initial_slider_position = slider_alloc->y;
|
||||
priv->slide_initial_coordinate_delta = y - slider_alloc->y;
|
||||
priv->slide_initial_slider_position = MAX (0, slider_alloc->y);
|
||||
priv->slide_initial_coordinate_delta = y - priv->slide_initial_slider_position;
|
||||
}
|
||||
else
|
||||
{
|
||||
priv->slide_initial_slider_position = slider_alloc->x;
|
||||
priv->slide_initial_coordinate_delta = x - slider_alloc->x;
|
||||
priv->slide_initial_slider_position = MAX (0, slider_alloc->x);
|
||||
priv->slide_initial_coordinate_delta = x - priv->slide_initial_slider_position;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user