-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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 Control rect coordinate system inconsistency #66688
Fix Control rect coordinate system inconsistency #66688
Conversation
1b8f532
to
f0a48d4
Compare
Note that with this implementation of Meaning It can be changed to: Transform2D t = get_transform();
return Rect2(t.get_origin, t.get_scale() * get_size()) which should be in the parent space when rotation is zero. For non-zero rotation the position obtained from Another thing which might be worth noting is that what Also another thing is there's |
@kleonc thanks for your detailed analysis. I will go through your notes and adjust my PR accordingly. Regarding your suggestion |
f0a48d4
to
1aa8f7e
Compare
I have updated the PR with the comments. |
1aa8f7e
to
b6e1744
Compare
b6e1744
to
bb211cf
Compare
Fix get_rect, get_global_rect and get_screen_rect to take Controls scale into account. Simplify get_screen_position and get_screen_rect
bb211cf
to
99bb7ab
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.
Approved in PR review meeting.
Thanks! |
Fix
get_rect
,get_global_rect
andget_screen_rect
to takeControl
s scale into account.supersedes & extracted from #37765 authored by @ThakeeNathees (no response in a year)
Also implemented comments and additionally simplified
get_screen_rect
andget_screen_position
.related to #66602
Current behavior is, that the returned values are in different coordinate systems.
position
in canvas/screensize
in local spaceI would expect, that a function returns values in the same coordinate system.
MRP: BugGlobalRectScale.zip
Updated 2022-10-22: Fix merge conflict.