tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

zoom not compatible with to width / to height resizing #128

Closed bibimbop closed 11 years ago

bibimbop commented 11 years ago

In the pngs tab, zoom the image (in or out) by a few percent, then click on "to width" or "to height" -> the image doesn't fit. The zoom has to be done by either the arrows or by using ctrl+pgup/pgdown. Entering a new number doesn't seem to have the same effect.

tallforasmurf commented 11 years ago

The only thing I can reproduce is this:

What is happening is that ppPngs bases the zoom factor on the non-white pixel width, divided by the effective "viewport" width in pixels. When you zoom away out the scrollbars are removed, and the zoom is calculated based on the size of this full viewing area.

After the zoom is applied, IF it was such as to cause a VERTICAL scroll bar to appear, the zoom appears to be wrong. Clicking to Width the second time, the viewport width is now narrower by the width of a scroll bar -- that's 15px on Mac OS Snow Leopard, probably less on Mac OS Mountain Lion where they changed the UI, but probably some other number on Ubuntu or Win. So the calculation comes out a tiny bit different.

Similarly for height, except it is the appearance of a HORIZONTAL scroll bar that makes the difference.

I could force the scroll bars to be always present, then the zoom would always be right, but I would rather they come and go as needed. If the above is behavior you are seeing (zoom too high by just a little bit, and it corrects on the second button click) then I don't think it can be fixed.

bibimbop commented 11 years ago

You're right. No problem here.