Bug report #932
Zoom Full, Zoom To Layer and Zoom To Selection work wrong
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | Magnus Homann | ||
Category: | Map Canvas | ||
Affected QGIS version: | Regression?: | No | |
Operating System: | Debian | Easy fix?: | No |
Pull Request or Patch supplied: | Resolution: | fixed | |
Crashes QGIS or corrupts data: | Copied to github as #: | 10991 |
Description
1. Create a vector with one rectangular polygon, fairly wider than tall.
2. Add it to QGIS.
3. The display extent should be adjusted to layer borders exactly. You can see it's not - on the right it is off by a pixel or 2 (one can't see the layers border to the right).
4. "Zoom To Layer" now - QGIS zooms out by a fairly big amount instead.
5. "Zoom Full" now - it zooms in, but not correctly - like in point #3907.
6. Select the feature. "Zoom To Selection" now - the result is the same like in point #3908.
If you create a vector containing one rectangular polygon, but fairly taller than wide instead, and reproduce the steps, the 1-2 pixels offset takes place on the bottom edge of the canvas.
SVN r8098, built and running against stock QT 4.3.2 on Ubuntu Gutsy x86.
Associated revisions
Make zoomToLayer, zoomFull and zoomSelected all adds the same five percent margin around the extent. Fixes #932.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8099 c8812cc2-4d05-0410-92ff-de0c093fc19c
Make zoomToLayer, zoomFull and zoomSelected all adds the same five percent margin around the extent. Fixes #932.
git-svn-id: http://svn.osgeo.org/qgis/trunk@8099 c8812cc2-4d05-0410-92ff-de0c093fc19c
History
#1 Updated by Magnus Homann almost 17 years ago
- Status changed from Open to In Progress
With Qt drawing system, it can never be moer exact than it is. The line border width makes a difference regarding 1 or 2 pixels.
Zoom to layer was changed to give a margin around the layer, possibly the same should be done for the other zoom tools also.
See #881
#2 Updated by Magnus Homann almost 17 years ago
- Resolution set to fixed
- Status changed from In Progress to Closed
I added the same margin (5%) for all three zoom methods in bc200fe8 (SVN r8100).
#3 Updated by Maciej Sieczka - almost 17 years ago
- Resolution deleted (
fixed) - Status changed from Closed to Feedback
Replying to [comment:1 homann]:
With Qt drawing system, it can never be moer exact than it is.
Hmm, but it works perfectly fine, to a single pixel, in QGIS 0.8.1 93e45f0d (SVN r7194), while in 0.9 SVN 9b7ec286 (SVN r8099) it doesn't, with the same data. Both QGIS versions built against QT 4.3.3. Seems like a regression. Smallish but anyway. Maybe worth looking into, might a symptom of some undesired change?
The line border width makes a difference regarding 1 or 2 pixels.
Not the case. I'm reffering to a default 1 pixel width in all examples here.
As to the forced 5% margin when zooming too a layer/selection/all - generally good idea, but not always desired. Best if it was configurable.
#4 Updated by Magnus Homann almost 17 years ago
Can you please re-state what you think does not work as expected? A 5% margin means that there is normally more than 1 pixel between layer and canvas edge, so that is not a problem anymore.
0.9.2 is closed for bug fixing.
#5 Updated by sieczka - almost 17 years ago
Replying to [comment:4 homann]:
Can you please re-state what you think does not work as expected?
If not the 5% margin, there is a 1 pixel offset to the right and bottom when you zoom to layer/selection/all.
A 5% margin means that there is normally more than 1 pixel between layer and canvas edge,
so that is not a problem anymore.
The recently introduced 5% margin just hides the issue, not fix it.
Since in QGIS 0.8.1 the 1 pixel offset at zoom to layer/selection/all is not present, and it is present in 0.9, it's a regression.
0.9.2 is closed for bug fixing.
Too bad.
#6 Updated by Magnus Homann almost 17 years ago
- Resolution set to fixed
- Status changed from Feedback to Closed
1) We got an enhancement request for a margin when zooming. I agreed, posted a question to the amiling list and got no objections and changed the functionality.
2) As the functionality has changed intentionality , it will not work the same as in 0.8.1 and it should not either. There is no regression problem.
3) Even in 0.8.1 it did not work reliably as you state, as it was dependent on line width (I have verified this).
For these three reasons, I will mark this issue as closed. If you want the old functionality back, open a new issue and mark it as enhancement (or re-name this).
#7 Updated by Anonymous over 15 years ago
Milestone Version 1.0.0 deleted