Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#932 closed bug (fixed)

Zoom Full, Zoom To Layer and Zoom To Selection work wrong

Reported by: msieczka Owned by: homann
Priority: major: does not work as expected Milestone:
Component: MapCanvas Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: Debian
Platform Version: Awaiting user input: no

Description

  1. Create a vector with one rectangular polygon, fairly wider than tall.
  1. Add it to QGIS.
  1. 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).
  1. "Zoom To Layer" now - QGIS zooms out by a fairly big amount instead.
  1. "Zoom Full" now - it zooms in, but not correctly - like in point #3.
  1. Select the feature. "Zoom To Selection" now - the result is the same like in point #4.

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.

Change History (8)

comment:1 by homann, 16 years ago

Milestone: Version 0.9.2Version 1.0
Must Fix for Release: YesNo
Owner: changed from nobody to homann
Priority: major: does not work as expectedminor: annoyance or enhancement
Status: newassigned
Type: bugenhancement

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

comment:2 by homann, 16 years ago

Resolution: fixed
Status: assignedclosed

I added the same margin (5%) for all three zoom methods in r8099.

in reply to:  1 comment:3 by msieczka, 16 years ago

Milestone: Version 1.0Version 0.9.2
Must Fix for Release: NoYes
Priority: minor: annoyance or enhancementmajor: does not work as expected
Resolution: fixed
Status: closedreopened
Type: enhancementbug

Replying to 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 r7193, while in 0.9 SVN r8098 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.

comment:4 by homann, 16 years ago

Awaiting user input: set
Milestone: Version 0.9.2Version 1.0

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.

in reply to:  4 comment:5 by sieczka, 16 years ago

Replying to 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.

comment:6 by sieczka, 16 years ago

Awaiting user input: unset

comment:7 by homann, 16 years ago

Resolution: fixed
Status: reopenedclosed

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).

comment:8 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.