Fix aspect ratio in selection widget when pressing CTRL - #4651
Conversation
|
Nice fix. Also great to catch the division by zero. I initially didn't think about that. As a general comment and not specific to this PR, I was puzzled why even changing the variable name and prepend |
|
Thank you for the review!
I moved the aspect ratio from a local function variable to a class member variable. The |
|
ElTh0r0 Thank you for this patch, waiting for releasing that! |
|
Hi @borgmanJeremy |
|
Thanks for the ping! Lost track of this one. |
Another approach to fix aspect ratio in selection widget when pressing CTRL (fix for #3436).
This PR gets the aspect ratio only once when the left mouse button is pressed. Before, the aspect ratio was permanently calculated while the mouse was moved, but QWidget:geometry only returns a QRect with integer precision, so we constantly lost aspect ratio precision while the mouse was moved.
There is another old PR #3439, which was never finalized. It may be closed if this one is merged.