Fix clipping of SmartHint when FloatingScale > 1 #3544
Merged
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.
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 theRenderSize
.This PR achieves the desired behavior by setting
UIElement.Clip
property on theGrid
and calculating aRectangleGeometry
based on theActualWidth
of the hint, and a non-bounded height (i.e. usingdouble.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 keepsTopLeft=(0,0)
.Animations slowed down to better see the issue.
Before:
![SmartHintClippingIssue](https://private-user-images.githubusercontent.com/19572699/326179346-f689c35d-89b6-40b4-92f0-9d9d7788b862.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyMDAzMTQsIm5iZiI6MTcyMDIwMDAxNCwicGF0aCI6Ii8xOTU3MjY5OS8zMjYxNzkzNDYtZjY4OWMzNWQtODliNi00MGI0LTkyZjAtOWQ5ZDc3ODhiODYyLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA1VDE3MjAxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZkNzUxMGFhMjIzYjI1ZjAwYzA0ODAxMTg2MTA4ZmQ1YTg2MTZkMDBkNmRlNGQxMGRiYjU5YTlkNjY3NGMzOTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Nvqd-T1xiv4es6Wi6U1jYWeY1cBhvm6uJM-5e1P63l4)
After:
![SmartHintClippingIssueResolved](https://private-user-images.githubusercontent.com/19572699/326179355-121b6f62-e193-4b12-8213-b83c89af3d85.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyMDAzMTQsIm5iZiI6MTcyMDIwMDAxNCwicGF0aCI6Ii8xOTU3MjY5OS8zMjYxNzkzNTUtMTIxYjZmNjItZTE5My00YjEyLTgyMTMtYjgzYzg5YWYzZDg1LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA1VDE3MjAxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQyMzRlYjgzODYzYjVlN2IxNjQ5MDA5M2I4MmJjYzYxNmZiMDY0MjVjMzRkMTI0ZTE5YTBmNjFjMTJiYjU5MDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VedXsVS3zVAOHlx6zGpi7zdlLe3fmhnDwhgaLQmL0Q4)