-
Notifications
You must be signed in to change notification settings - Fork 176
[win32] Unify scaling inside Control::setBounds #1769
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
[win32] Unify scaling inside Control::setBounds #1769
Conversation
59d2913
to
ad2025a
Compare
This commit unifies scale up results in Control::setBounds. With zoom values not dividable by 100 different result depending on using setBounds(Rectangle) or setBounds(int, int, int, int) were possible. Scaling the bounds always as rectangle solves this limitation.
ad2025a
to
8dff732
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akoch-yatta this PR caused a regression --> #2003. What was the observable bug that was fixed by this PR? Is it safe to revert? |
@fedejeanne this PRs prevents rendering artifacts that would reappear when reverting. I dont't Out of my mind which ones are prevented by this change |
I see. Well, let's discuss next week how to proceed with this since the fix seems broken. I share the idea of using only 1 logic to scale things up/down but maybe some use cases are still using the "old" approach in disguise (i.e. scaling width/height instead of calculating them like If my assumption is correct, we should explore going exactly the other way i.e. changing public static Rectangle scaleUp(Rectangle rect, int zoom) {
if (zoom == 100 || rect == null)
return rect;
return new Rectangle(DPIUtil.scaleUp(rect.x, zoom), //
DPIUtil.scaleUp(rect.y, zoom), //
DPIUtil.scaleUp(rect.width, zoom), //
DPIUtil.scaleUp(rect.height, zoom));
} But I need to know which use cases were fixed by this PR in order to validate this proposal. Thank you, @akoch-yatta ! |
fwiw: the mentioned regression should have been fixed via this PR: |
This commit unifies scale up results in Control::setBounds. With zoom values not dividable by 100 different result depending on using setBounds(Rectangle) or setBounds(int, int, int, int) were possible. Scaling the bounds always as rectangle solves this limitation.