Feature request #4173
Zoom out tool-variability
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Steven Mizuno | ||
Category: | Map Canvas | ||
Pull Request or Patch supplied: | Yes | Resolution: | fixed/implemented |
Easy fix?: | No | Copied to github as #: | 14149 |
Description
The zoom out tool could maybe be improved by working more like ArcMap/Mapinfo.
I find it very useful to be able too zoom out much or little depending on
how big "zoom box" I draw with the zoom out tool.
In ArcMap/Mapinfo it works like this: A large zoom-box makes a small zoom out. A
small zoom-box makes a big change in scale.
The zoom out algorithm could be something like this: A full zoom out box covering the whole screen = no zoom, if the zoom box is 50% of screen=double scale, if zoom box 1/4 of screen= 4 times the scale, 1/10 of screen= 10times the scale.
There is already some zoom out variability in qgis but it only works if zoom out box is drawn from right to left or bottom to top of screen.
History
#1 Updated by Steven Mizuno over 13 years ago
- Assignee set to Steven Mizuno
I can take this one - I was already considering the changes suggested. Also have found some minor issues with how the zoom rectangle is transformed to map coordinates.
#2 Updated by Steven Mizuno over 13 years ago
- File patch_for_4173.diff added
- Pull Request or Patch supplied changed from No to Yes
Map Tool Zoom (In/Out) improvements and fixes - patch
Problems found:- it is hard to get the starting point of the zoom rectangle exactly where you click
[needed to fix 1 before 2 and 3 can be tested] - carefully drawing a zoom rectangle from exact upper left corner of map canvas to lower right zooms slightly. I would expect zoom ratio of 1.0, hence no change.
- reversing step 2 - draw from lower right to upper left also zooms, but slightly different value
- record start point on mouse press, rather than on mouse move (there is typically a few pixels' movement of mouse before drag is registered; therefore, the position reported is where the drag was recognized.
- adjust the zoomrect (integer pixel values) by 1 - right, bottom to get the outside of the rectangle for transform to map coordinates
- normalize the completed zoomrect before further processing
- allow variable zoom out - calc. ratio of old to new extent; take smaller of zoom ratio width or height to scale by
- allow Ctrl key to invert operation of zoom in/zoom out (no visual indication, such as changing the cursor, is provided)
Effective on mouse release; no effect until then.
- exact upper left to lower right corner (any corner to diagonally opposite corner), zoom in or out should be no change in scale or extent - tests that zoom rect is same as map extent
- begin a zoom rect on some pixel, drag to start the rect, then position up and left 1 pixel from start point (using intersecting vector lines helps) scales by the smaller of the map canvas dimensions to 1 (or the inverse) - tests case where zoom rect is empty; is adjusted to 1px
- like test 2 - except position over the start point; should be same result as test 2 - tests the 1px case
- for any zoom rect that exceeds a dimension (either) of the map canvas the zoom is reversed (zoom in becomes zoom out, for example)
easiest to test by having the main window less than full screen and starting near one corner and dragging beyond the diagonally opposite corner
#3 Updated by Giovanni Manghi almost 13 years ago
- Target version set to Version 1.7.4
#4 Updated by Giovanni Manghi over 12 years ago
- Target version changed from Version 1.7.4 to Version 2.0.0
#5 Updated by Paolo Cavallini about 12 years ago
Can we apply this patch?
#6 Updated by Pirmin Kalberer about 12 years ago
- Target version changed from Version 2.0.0 to Future Release - Nice to have
#7 Updated by Nyall Dawson over 8 years ago
- Resolution set to fixed/implemented
- Status changed from Open to Closed
Most of this behavior is now implemented. New tickets can be reopened if there's anything missing from this.