-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use RectangleClip for rounded corner border
- Loading branch information
1 parent
35a8e98
commit 0f71961
Showing
7 changed files
with
79 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
#nullable enable | ||
|
||
#nullable enable | ||
|
||
using SkiaSharp; | ||
|
||
namespace Windows.UI.Composition; | ||
|
||
partial class RectangleClip | ||
{ | ||
private SKRoundRect _skRoundRect; | ||
private SKPoint[] _radii = new SKPoint[4]; | ||
private static readonly SKPoint[] _radiiStore = new SKPoint[4]; | ||
|
||
private SKRoundRect? _skRoundRect; | ||
|
||
internal SKRoundRect SKRoundRect => GetRect(); | ||
|
||
private void GetRect() | ||
private SKRoundRect GetRect() | ||
{ | ||
_skRoundRect ??= new SKRoundRect(); | ||
|
||
_radiiStore[0] = new SKPoint(_topLeftRadius.X, _topLeftRadius.Y); | ||
_radiiStore[1] = new SKPoint(_topRightRadius.X, _topRightRadius.Y); | ||
_radiiStore[2] = new SKPoint(_bottomRightRadius.X, _bottomRightRadius.Y); | ||
_radiiStore[3] = new SKPoint(_bottomLeftRadius.X, _bottomLeftRadius.Y); | ||
|
||
_skRoundRect.SetRectRadii( | ||
new SKRect( | ||
Left, | ||
Top, | ||
Right, | ||
Bottom), | ||
_radii); | ||
_radiiStore); | ||
return _skRoundRect; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters