GNOME Bugzilla – Bug 556603
Zoom region always zooms in center of image
Last modified: 2008-10-28 18:25:36 UTC
If I want to zoom a region of image, for example upper right corner, using Zoom tool (drawing a rectangle over; clicking on part I want to zoom; or using the mouse wheel while cursor over the part I want to zoom) the image zooms but centers itself and I need to pan the image. Expected: Zoom with rectangle drawn - Area that's in the drawn rectangle zooms to the window size. Center of that area becomes center of the window. Zoom by clicking / using mouse wheel - Zoom the area where the clicked point (or in case of mouse wheel, hot spot of cursor) becomes the centre of zoomed area.
Seems to work just fine for me. We need more information to handle this report. Please give details about your system, your gimp preferences and include a detailed description that allows us to reproduce the problem.
What the reporter means is: - select the zoom tool - move mouse to any point != canvas center - press plus or minus -> pixel under cursor stays where it is - click -> pixel under cursor moves to canvas center The last behavior is clearly a bug.
Oh, clicking with the Zoom tool. I even forgot that this is a possible use case.
I have a patch for that, will commit later tonight.
Sorry for late reply. My system spec is: Windows XP Pro SP3 - English RAM: 2GB CPU: Intel Core 2 Duo 2.66 GHz Graphics Card: NVIDIA Geforce 8600 GT (Driver version: 6.14.11.7519 16/05/2008) Screen resolution: 1680x1050 32Bit (DPI: 96) I don't think I've changed GIMP preferences much after installation of this version. What I did for sure was saving windows position. Here are some of the preferences I have: Image Windows > (all checkboxes checked); Initial Zoom Ratio = Fit to Window; While Spacebar is pressed = Pan View; Pointer mode = Tool icon; Pointer rendering = Fancy Image Windows > Appearance > (all checkboxes checked except 'Show Grid' for both modes); Canvas Padding Mode = From theme (for both modes); If you want to know details of specific hardware component, or Gimp preference that I didn't mention above, please let me know. @Michael Natterer I didn't check plus/minus keys before, but I'm afraid this doesn't work correctly too. Here are steps to reproduce the reported issue. (1-4 Same for all tested options) 1. Gimp started 2. Test Image loaded - 640x480 px (attached) 3. Image window resized so that whole canvas is displayed in 100% zoom (for some reason first loaded image doesn't fully show in image window). 4. Image window placed about in the middle of screen. Option 1: Plus / minus keys used with default tool selected as on starting GIMP (paitbrush). 1. Moved cursor over image fragment I wanted to zoom (number '1' in upper right part of image) 2. Pressed plus > Image zoomed, and window scaled to fit the zoomed image. Here the image window still fully on the screen. 3. Pressed plus again > Image zoomed. Region that wanted to zoom still visible. Window scaled to fit the zoomed image. Here image window scaled and its bottom and right part went over the screen. 4. Pressed plus again > Image zoomed, but this time, canvas centered on black circle. Option 2: Zoom tool used by drawing rectangle 1. Drawn rectangle just over the the number '1'. The size of rectangle was 124 x 150 pixels > Image zoomed and window rescaled (part of it dissappeared outside of the screen as previously). Strange thing here though. The black circle appeared as if in the centre of zooming area - like if in the image window before it was stretched to fit the canvas. Option 3: Zoom tool used by clicking the mouse button. 1. Cursor positioned over the black number '1' and clicked. (Behavior same as for option 1. 2 clicks appeared ok. On second click image window was stretched outside of my screen. On third click canvas was centered on black circle). Option 4: Ctrl + Mouse Wheel used with default tool selected (paintbrush) 1. Cursor position over the black number '1', ctrl pressed and mouse wheel used to zoom in. (Results exactly the same as for option 1 and 3). Primarily I thought that the problem may have something to do with that the image window, after it was stretched to fit canvas, wasn't fully displayed on the screen. However, I quickly checked this and repositioned the image window (after test image was loaded) in top right corner of my screen. With that position even after 3 zoom in steps the image window was still fully visible on my screen, but the result after 3rd zoom in step was exactly the same as described above for each option tested. I hope this will be of better help for you. I have also attached the test image for reference.
Created attachment 120924 [details] Reference test image
Mitch, you said you have a patch for this that would be ready for commit?
Fix commited to trunk, rev 27452: 2008-10-28 Martin Nordholts <martinn@svn.gnome.org> Bug 556603 – Zoom region always zooms in center of image * app/tools/gimpmagnifytool.c (gimp_magnify_tool_button_release): When zooming with a click, use gimp_display_shell_scale() instead of local zoom logic.
And gimp-2-6, rev 27454.