Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for aspect ratio losing ratio #3439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brunoais
Copy link

Fix for aspect ratio losing ratio (bad code version)

The reason why it's bad code is because I'm using a global variable for this purpose and that is a really bad idea. Unfortunately, I don't know where can this information be stored.

Please help: The part I'm missing is somewhere to store the float variable. Once I have a suitable place, this PR is complete.

Note: I'm not used to C++ code, this is my first time working with C++ code without prior help, please be patient.

Fixes #3436

The problem was that the ratio was being calculated on every "tick" of movement instead of keeping it.
So every pixel moved, a new ratio was calculated which is not the user's intent.
This way, the ratio is kept while the user is resizing the image and tries to minimize the rounding issues.
Rounding issues still exist but they are now only minimal on at what is highest of the ratio.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using CTRL to resize and maintain aspect ratio doesn't work if the ratio is not 1:1
1 participant