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 clipping of SmartHint when FloatingScale > 1 #3544

Merged
merged 3 commits into from
Apr 27, 2024
Merged

Fix clipping of SmartHint when FloatingScale > 1 #3544

merged 3 commits into from
Apr 27, 2024

Conversation

nicolaihenriksen
Copy link
Contributor

Fixes #3543

The purpose of the "hint clipping grid" is to ensure it does not exceed the available horizontal space. This is currently done using ClipToBounds=True which clips the hint along both the X- and Y-axis. However, what is really needed is a clipping which only "clips to bounds" along the X-axis of the RenderSize.

This PR achieves the desired behavior by setting UIElement.Clip property on the Grid and calculating a RectangleGeometry based on the ActualWidth of the hint, and a non-bounded height (i.e. using double.MaxValue as the upper bound). This effectively clips the hint along the X-axis as it was before, but still allows the hint to grow indefinitely downwards the Y-axis. It is sufficient to only allow the hint to grow downwards because the scaling of the hint always keeps TopLeft=(0,0).

Animations slowed down to better see the issue.

Before:
SmartHintClippingIssue

After:
SmartHintClippingIssueResolved

@nicolaihenriksen nicolaihenriksen added this to the 5.1.0 milestone Apr 27, 2024
@Keboo Keboo merged commit dd9c6f9 into master Apr 27, 2024
2 checks passed
@Keboo Keboo deleted the fix3543 branch April 27, 2024 18:14
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.

SmartHint is clipped when FloatingScale > 1
2 participants