-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove IBoxView * Fix device tests Co-authored-by: Rui Marinho <me@ruimarinho.net>
- Loading branch information
1 parent
15ba091
commit 7cac05a
Showing
20 changed files
with
177 additions
and
326 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,7 +1,50 @@ | ||
namespace Microsoft.Maui.Controls | ||
#nullable enable | ||
using System.Runtime.CompilerServices; | ||
using Microsoft.Maui.Graphics; | ||
|
||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class BoxView : IBoxView | ||
public partial class BoxView : IShapeView, IShape | ||
{ | ||
protected override void OnPropertyChanged([CallerMemberName] string? propertyName = null) | ||
{ | ||
base.OnPropertyChanged(propertyName); | ||
|
||
if (propertyName == ColorProperty.PropertyName || | ||
propertyName == CornerRadiusProperty.PropertyName) | ||
Handler?.UpdateValue(nameof(IShapeView.Shape)); | ||
} | ||
|
||
IShape? IShapeView.Shape => this; | ||
|
||
PathAspect IShapeView.Aspect => PathAspect.None; | ||
|
||
Paint? IShapeView.Fill => Color?.AsPaint() ?? ((IView)this).Background; | ||
|
||
Paint? IShapeView.Stroke => null; | ||
|
||
double IShapeView.StrokeThickness => 0; | ||
|
||
LineCap IShapeView.StrokeLineCap => LineCap.Butt; | ||
|
||
LineJoin IShapeView.StrokeLineJoin => LineJoin.Miter; | ||
|
||
float[]? IShapeView.StrokeDashPattern => null; | ||
|
||
float IShapeView.StrokeMiterLimit => 0; | ||
|
||
PathF IShape.PathForBounds(Rectangle bounds) | ||
{ | ||
var path = new PathF(); | ||
|
||
path.AppendRoundedRectangle( | ||
bounds, | ||
(float)CornerRadius.TopLeft, | ||
(float)CornerRadius.TopRight, | ||
(float)CornerRadius.BottomLeft, | ||
(float)CornerRadius.BottomRight); | ||
|
||
return path; | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
4 changes: 3 additions & 1 deletion
4
src/Core/src/Graphics/IShapeView.cs → src/Core/src/Core/IShapeView.cs
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.