Skip to content

Commit

Permalink
feat: Added CompositionLineGeometry implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
VitezslavImrysek committed Jul 30, 2021
1 parent 3c5bc14 commit fe75691
Show file tree
Hide file tree
Showing 3 changed files with 43 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 CompositionLineGeometry : 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 Start
{
Expand All @@ -21,7 +21,7 @@ public partial class CompositionLineGeometry : global::Windows.UI.Composition.C
}
}
#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 End
{
Expand Down
29 changes: 29 additions & 0 deletions src/Uno.UWP/UI/Composition/CompositionLineGeometry.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 CompositionLineGeometry : CompositionGeometry
{
private Vector2 _start;
private Vector2 _end;

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

}

public Vector2 Start
{
get => _start;
set => SetProperty(ref _start, value);
}

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

using Windows.Graphics;

namespace Windows.UI.Composition
{
public partial class CompositionLineGeometry : CompositionGeometry
{
internal override IGeometrySource2D? BuildGeometry() => new SkiaGeometrySource2D(BuildLineGeometry(Start, End));
}
}

0 comments on commit fe75691

Please sign in to comment.