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 TouchScreenButton not redrawn when texture changes #75016

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

timothyqiu
Copy link
Member

Updating AtlasTexture rect does not redraw TouchScreenButton.

@timothyqiu timothyqiu added bug cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:2d cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release cherrypick:4.0 labels Mar 17, 2023
@timothyqiu timothyqiu added this to the 4.1 milestone Mar 17, 2023
@timothyqiu timothyqiu requested a review from a team as a code owner March 17, 2023 07:29
@KoBeWi
Copy link
Member

KoBeWi commented Apr 21, 2023

Reminds me of #75532
Could also be refactored to avoid repeating the code, but otherwise it's probably fine.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing I noticed is that assigning the same texture will still run the whole logic. We could add an early return (shape is missing it too).

Also I wonder why only drawing was broken. Changing the atlas seems to update node's handles properly even without this PR 🤔

@timothyqiu
Copy link
Member Author

Also I wonder why only drawing was broken. Changing the atlas seems to update node's handles properly even without this PR

The handles are drawn by the canvas item editor. It checks for bounding rect changes in every physics process notification.

@akien-mga akien-mga merged commit ee38afc into godotengine:master Apr 24, 2023
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the watch-out branch April 24, 2023 14:51
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.3.

@akien-mga
Copy link
Member

Would need a dedicated PR for 3.x if wanted, as there are significant conflicts.

@akien-mga akien-mga removed cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release labels Aug 28, 2023
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.

4 participants