Closed ztywyj closed 4 months ago
I'm not sure if this is my issue, but my demo indeed has problems with the initial scaling due to this issue.
Thanks! I'll be having a look at this over the weekend :)
I don't seem to be able to reproduce this. Could you provide detailed information on your environment, platform etc. as well as the steps necessary to demonstrate the issue?
My Qt version is Qt 5.15.2 MSVC 2019 64-bit. In the compiled demo, when you open it and hold down the Ctrl key while scrolling the mouse wheel, the initial zoom level is unusually large, but it returns to normal after that.
I... have no idea how we've never noticed this. We can certainly reproduce it. Most likely our consuming applications are initializing the zoom level themselves.
Had a look at this and you're (obviously) correct.
However, I do think that the correct thing to do is to call setZoomValue(1.0)
at the end of the View
constructor to prevent "code duplication".
Do you want to update your accordingly or should I just commit the fix myself?
Sure. Updated.
Merged - Thanks!
The default value of _scaleFactor is 1, and the calculated initial zoom is 10. This causes issues with the initial scaling. The default zoom should be 1, and then calculate the initial value of _scaleFactor from there. The result is 0.375804.