widgets: Implement zoom focus in gradient editor

Zoom focus centers the point that we're zooming into at the location of
the mouse pointer.

Default zoom focus value is 0.5 which results in previous behavior.
This commit is contained in:
Povilas Kanapickas 2022-04-06 18:47:16 +03:00 committed by Jehan
parent 8d0e6efa10
commit ae3c4c3577
3 changed files with 64 additions and 13 deletions

View file

@ -660,7 +660,7 @@ gradient_editor_zoom_cmd_callback (GimpAction *action,
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpZoomType zoom_type = (GimpZoomType) g_variant_get_int32 (value);
gimp_gradient_editor_zoom (editor, zoom_type, 1.0);
gimp_gradient_editor_zoom (editor, zoom_type, 1.0, 0.5);
}