GNOME Bugzilla – Bug 560245
Zoom selection always centered in the Navigation tab
Last modified: 2008-11-15 08:08:05 UTC
Please describe the problem: When using the Zoom Out, Zoom In and the Zoom slider in the Navigation tab the selection rectangle is always centered no matter where it was located before. Steps to reproduce: 1. Open picture 2. In the Navigation tab zoom in the picture using one of the buttons mentioned above and move the selection rectangle off the center. 3. Change the zoom ratio using Zoom In/Out or the slider. Actual results: The selection rectangle is reset to the center of the image. Expected results: The zoom selection rectangle stays at the same location in the navigation tab. Does this happen every time? Yes. Other information: This bug was introduced with GIMP 2.6.0
This is basically the same bug that also causes the view to be centered if the Zoom actions from the menus are used. In fact the buttons in the navigation editor and the Zoom menu entries invoke the same actions. The pixel in the center of the display should always stay in the center of the display when using these actions. This somehow broke on the way to 2.6 and should be fixed.
Created attachment 122448 [details] [review] fix-centering-issues-with-zoom-2008-11-11.patch One needs to take into account the image center, not only the zoom focus point, when figuring out whether or not to center. The patch fixes this. I will let the patch mature in my local tree before I commit it.
Corrected patch commited to trunk (rev 27651) and gimp-2-6: 2008-11-15 Martin Nordholts <martinn@svn.gnome.org> Bug 560245 – Zoom selection always centered in the Navigation tab * app/display/gimpdisplayshell-scale.c (gimp_display_shell_scale): Also take the image center and not only the zoom focus point into account when deciding whether or not to center the image after zoom.