Bug report #932
Zoom Full, Zoom To Layer and Zoom To Selection work wrong
|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|
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.
#1 Updated by Magnus Homann almost 14 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.
#3 Updated by Maciej Sieczka - almost 14 years ago
- Resolution deleted (
- 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.
#5 Updated by sieczka - almost 14 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.
#6 Updated by Magnus Homann almost 14 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).