Skip to content

Commit

Permalink
feat: Added CompositionEllipseGeometry implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
VitezslavImrysek committed Jul 30, 2021
1 parent fe75691 commit 10f2466
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Composition
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented]
#endif
public partial class CompositionEllipseGeometry : global::Windows.UI.Composition.CompositionGeometry
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::System.Numerics.Vector2 Radius
{
Expand All @@ -21,7 +21,7 @@ public partial class CompositionEllipseGeometry : global::Windows.UI.Compositio
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::System.Numerics.Vector2 Center
{
Expand Down
29 changes: 29 additions & 0 deletions src/Uno.UWP/UI/Composition/CompositionEllipseGeometry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#nullable enable

using System.Numerics;

namespace Windows.UI.Composition
{
public partial class CompositionEllipseGeometry : CompositionGeometry
{
private Vector2 _radius;
private Vector2 _center;

internal CompositionEllipseGeometry(Compositor compositor) : base(compositor)
{

}

public Vector2 Radius
{
get => _radius;
set => SetProperty(ref _radius, value);
}

public Vector2 Center
{
get => _center;
set => SetProperty(ref _center, value);
}
}
}
12 changes: 12 additions & 0 deletions src/Uno.UWP/UI/Composition/CompositionEllipseGeometry.skia.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#nullable enable

using Windows.Graphics;

namespace Windows.UI.Composition
{
public partial class CompositionEllipseGeometry : CompositionGeometry
{
internal override IGeometrySource2D? BuildGeometry()
=> new SkiaGeometrySource2D(BuildEllipseGeometry(Center, Radius));
}
}

0 comments on commit 10f2466

Please sign in to comment.