Skip to content

Fix unexpected control position change when left/top offsets not match pos_cache #106141

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

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

Conversation

L2750558108
Copy link
Contributor

@L2750558108 L2750558108 commented May 7, 2025

In #104357, in order to prevent the size of the offsets from being broken during offsets recalculate in set_position, the rect which use size calculated in real time via the offsets (previously use size_cache) is used when the offsets are recalculated in set_position.

But this doesn't take into account the position of the rect. If the current pos_cache does not match (edge[0], edge[1]) calculated via offsets (e.g. the control's size is propped up by the minimum size when the grow_direction is not Right/Bottom), the position of the control may be offset to the top left of the expected position. This pr solve this

Fixes : #105771

@L2750558108 L2750558108 requested a review from a team as a code owner May 7, 2025 10:19
@KoBeWi KoBeWi added this to the 4.5 milestone May 7, 2025
@L2750558108 L2750558108 changed the title Fix unexpected control position changed when left/top offsets not match pos_cache Fix unexpected control position change when left/top offsets not match pos_cache May 7, 2025
@L2750558108 L2750558108 force-pushed the fix-control-position branch from d4dfd67 to 49c7966 Compare May 7, 2025 10:47
@KoBeWi
Copy link
Member

KoBeWi commented May 7, 2025

It fixes the regressions, but it might introduce a new one, just like the previous fixes.
Ideally we should have tests at least for each issue in the chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Control's global position set to wrong value
2 participants