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 TextureButton's click mask texture size ignored if missing normal texture #92222

Conversation

semensanyok
Copy link
Contributor

@semensanyok semensanyok commented May 21, 2024

although click/hover now works correctly, precisely detecting expected borders, it logs error for abscent "normal" texture.

scene\main\canvas_item.cpp:785 - Condition "p_texture.is_null()" is true

not sure what to do with that message yet, and if it needs to be fixed or not. is error message in case of missing normal texture expected?
fixed error log message https://github.com/godotengine/godot/pull/92222/files#diff-d9ffa969dbdabac1b846bcdcddd360802270fcabb040bae52bde2a3ab549c423#241:~:text=%7D%20else%20if%20(texdraw.is_valid())%20%7B

@semensanyok semensanyok requested a review from a team as a code owner May 21, 2024 20:51
@AThousandShips AThousandShips changed the title Fix#91898 TextureButton's click mask texture size ignored if missing normal texture Fix TextureButton's click mask texture size ignored if missing normal texture May 21, 2024
@semensanyok semensanyok force-pushed the fix-TextureButton-click-mask-texture-size-ignored-if-missing-normal-texture branch from 4afac19 to 6200f09 Compare May 21, 2024 21:43
@AThousandShips AThousandShips added this to the 4.3 milestone May 22, 2024
@KoBeWi
Copy link
Member

KoBeWi commented May 25, 2024

I don't like how this makes an empty draw just to calculate texture size 🤔 But it's a pre-existing logic, so for now it works I guess.

@semensanyok semensanyok force-pushed the fix-TextureButton-click-mask-texture-size-ignored-if-missing-normal-texture branch 2 times, most recently from 29a71d2 to a30229a Compare May 25, 2024 11:20
scene/gui/texture_button.cpp Outdated Show resolved Hide resolved
@semensanyok semensanyok force-pushed the fix-TextureButton-click-mask-texture-size-ignored-if-missing-normal-texture branch from a30229a to 63554c7 Compare May 25, 2024 13:40
@akien-mga akien-mga merged commit cfe80f9 into godotengine:master May 28, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

TextureButton click mask doesn't scale correctly without other textures present
4 participants