-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Fixes border content clipping #17310
Conversation
Fixes clip path size to consider the border stroke thickness, so it only uses the inner space. For the space the border takes we consider both sides (top and bottom, or left and right) and not just the thickness. On top of that, the clip should not be sentered with the content, so we need to offset it based on the contents position.
Fixes clip path size to consider the border stroke thickness, so it only uses the inner space. For the space the border takes we consider both sides (top and bottom, or left and right) and not just the thickness. On top of that, the clip should not be sentered with the content, so we need to offset it based on the contents position.
Add stroke thickness to polygon border
This PR partially fixes how content in borders with shapes other than rectangles clip, but there are still two problems:
|
Polygon just returns the original path: https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Shapes/Polygon.cs#L53-L68. And this is something that happens with other shapes too, like polyline https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Shapes/Polyline.cs. On the other hand, ellipse does consider the bounds through Width/HieghtForPathComputation https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Shapes/Ellipse.cs#L30-L45, which maks it work correctly. |
Is this ready for review? |
Hi @emaf. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time. |
Filed the Image clipping issue here: #17523 |
@@ -45,6 +45,18 @@ | |||
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#FFFFFF" BaseSize="168,208" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<Compile Update="Elements\Border1.xaml.cs"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed (thanks to jeff earlier)
Fully enabling the tests is now moved a separate PR, here: #17633, so that we can merge this PR ASAP. |
Description of Change
Fixes clip path size to consider the border stroke thickness, so it only uses the inner space. For the space the border takes we consider both sides (top and bottom, or left and right) and not just the thickness.
On top of that, the clip should not be sentered with the content, so we need to offset it based on the contents position.
Issues Fixed
Fixes #17109
Fixes #16444
Fixes #17500