Commit f3e068bb authored by Cosimo Cecchi's avatar Cosimo Cecchi

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.
parent fce344d3
...@@ -2617,13 +2617,13 @@ update_initial_slider_position (GtkRange *range, ...@@ -2617,13 +2617,13 @@ update_initial_slider_position (GtkRange *range,
if (priv->orientation == GTK_ORIENTATION_VERTICAL) if (priv->orientation == GTK_ORIENTATION_VERTICAL)
{ {
priv->slide_initial_slider_position = slider_alloc->y; priv->slide_initial_slider_position = MAX (0, slider_alloc->y);
priv->slide_initial_coordinate_delta = y - slider_alloc->y; priv->slide_initial_coordinate_delta = y - priv->slide_initial_slider_position;
} }
else else
{ {
priv->slide_initial_slider_position = slider_alloc->x; priv->slide_initial_slider_position = MAX (0, slider_alloc->x);
priv->slide_initial_coordinate_delta = x - slider_alloc->x; priv->slide_initial_coordinate_delta = x - priv->slide_initial_slider_position;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment