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 PopupMenu tooltip alignment when scrolling #91181

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

Conversation

aaronp64
Copy link
Contributor

@aaronp64 aaronp64 commented Apr 25, 2024

Call xform() on position before passing into PopupMenu::get_tooltip, to undo earlier affine_inverse().xform() call. PopupMenu already adjusts for the control's position when checking which item is selected. Also adjust for PopupMenu's content scale factor to keep tooltips aligned if the scale factor is not 1.

Fixes #91085.

Bugsquad edited: Supersedes #90922.

@aaronp64 aaronp64 requested a review from a team as a code owner April 25, 2024 21:07
@YeldhamDev YeldhamDev added this to the 4.3 milestone Apr 26, 2024
@aaronp64
Copy link
Contributor Author

This may need to change if #91997 is merged

Call xform() on position before passing into PopupMenu::get_tooltip, to undo earlier affine_inverse().xform() call.  PopupMenu already adjusts for the control's position when checking which item is selected.  Also adjust for PopupMenu's content scale factor to keep tooltips aligned if the scale factor is not 1.

Fixes godotengine#91085
@aaronp64 aaronp64 force-pushed the popup_menu_tooltips branch from 09a99fb to a6802a7 Compare June 11, 2024 18:57
@aaronp64
Copy link
Contributor Author

Updated to match the change from #91997, and added scale factor check that was missing in the previous commit.

I rebased before amending/force-pushing, not sure if I messed something up with that. The PR shows just the one file changed, but clicking "compare" on the "force-push" message shows a ton of changes - does this look ok?

Copy link
Contributor

@anniryynanen anniryynanen left a comment

Choose a reason for hiding this comment

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

I reproduced the bug in v4.3.rc1.official [e343dbb] and confirm that this PR fixes it.

I'm not super familiar with the functions being called but the added code look solid enough. Even though it is in Viewport, I think regression risk is small because the change is very local.

I'm not sure what's up with the compare link in the force push, but I'm guessing it's ok since "files changed" includes the scale factor check.

@KoBeWi KoBeWi modified the milestones: 4.3, 4.4 Aug 1, 2024
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.

OptionButtons do not display tooltips correctly when scrolled downwards
4 participants