Fix: Menu popups and tooltips don't respect layer transforms #4708
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The menu buttons, combo box menus, and tooltips don't take layer transforms into account when placing their popups, resulting in popups being placed in the wrong location.
This PR makes the popups take layer transforms into account, transforming the positions before displaying them on screen. I implemented this fix for menu buttons, combo boxes, and tooltips; let me know if there's anything I missed.
Scaling of the popups is purposefully ignored for now. Personally, I think popup scaling isn't necessary but if it is required I can implement it (also it would require doing more invasive things to the code and I want to keep this as simple as possible.)
Before the fix: (with a modified version of the "Pan Zoom" web demo)
2024-06-25.19-01-30.mp4
After:
2024-06-25.19-43-06.mp4
The frame delay seems to be unavoidable unless we can move the popups after the layer transform is set (or apply the transforms to the popup during painting). I think this would be better implemented once the menu/popup/tooltip unification is done (#4669).