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 TabContainer click detection when UIScale was not == 1.0 #5456

Merged

Conversation

eoineoineoin
Copy link
Contributor

Fixes #5321.

Draw() and KeyBindDown() had copy-pasted-but-slightly-different code for calculating the size of each tab. The KeyBindDown() version didn't account for UIScale. Now, Draw() will just store the coordinates for each tab, and KeyBindDown() will look up the click location - removes code duplication, unnecessary calculations and fixes the bug.

Copy link
Member

@PJB3005 PJB3005 left a comment

Choose a reason for hiding this comment

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

This code is absolutely horrible but I can blame Godot so good enough for me.

@PJB3005 PJB3005 merged commit e714dcc into space-wizards:master Sep 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TabContainer's click bounds doesn't account for UI scale
2 participants