mirror of https://github.com/GNOME/gimp.git
widgets: Fix out of bounds zoom in gradient editor
When zooming using scroll events it is possible to zoom out of gradient bounds because the check for out of bounds zoom happens with the zoom value before the delta is applied. The correct way is to limit the zoom value after the delta is applied.
This commit is contained in:
parent
ae3c4c3577
commit
40743c90a2
|
@ -723,11 +723,11 @@ gimp_gradient_editor_zoom (GimpGradientEditor *editor,
|
|||
|
||||
case GIMP_ZOOM_OUT_MORE:
|
||||
case GIMP_ZOOM_OUT:
|
||||
if (editor->zoom_factor <= 1)
|
||||
return;
|
||||
|
||||
editor->zoom_factor -= delta;
|
||||
|
||||
if (editor->zoom_factor < 1)
|
||||
editor->zoom_factor = 1;
|
||||
|
||||
page_size = 1.0 / editor->zoom_factor;
|
||||
value = old_value - (page_size - old_page_size) * zoom_focus_x;
|
||||
|
||||
|
|
Loading…
Reference in New Issue