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

constrain both axis #5097

Merged
merged 5 commits into from
Oct 8, 2024
Merged

constrain both axis #5097

merged 5 commits into from
Oct 8, 2024

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Oct 6, 2024

Fixes #5007

This builds on the undocumented constrain rule. It can now accept two values for X and Y axis.

"inflect" will mirror the widget about the axis.
"inside" will prevent the widget from moving outside of the container.

Setting the tooltip's constrain to "inside inflect" seems to give a more typical tooltip behavor.

Also adds support for relative offsets. By setting the Tooltips x-offset to "-50%", it can be displayed centered underneath the cursor.

I think the combination of margin, constrain, and offset covers just about any behavior we might need from tooltips.

Screen.Recording.2024-10-07.at.18.54.28.mov

@willmcgugan willmcgugan marked this pull request as draft October 6, 2024 20:28
@willmcgugan willmcgugan marked this pull request as ready for review October 7, 2024 17:53
@willmcgugan
Copy link
Collaborator Author

Damn you @darrenburns This was supposed to be a 5 min job

Copy link
Member

@darrenburns darrenburns left a comment

Choose a reason for hiding this comment

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

Looks great!

@willmcgugan willmcgugan merged commit 4d4fb73 into main Oct 8, 2024
20 checks passed
@willmcgugan willmcgugan deleted the constrain-tooltips branch October 8, 2024 13:04
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.

Footer tooltip appears away from cursor
2 participants