-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16702 from Youssef1313/issues/16686
feat(skia): Support Shape.StrokeDashArray and CompositionStrokeDashArray
- Loading branch information
Showing
5 changed files
with
104 additions
and
140 deletions.
There are no files selected for viewing
13 changes: 6 additions & 7 deletions
13
.../UITests.Shared/Windows_UI_Xaml_Shapes/PathTestsControl/Path_With_DashStrokeArray.xaml.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
using Uno.UI.Samples.Controls; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl | ||
namespace SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl; | ||
|
||
[Sample("Path", IsManualTest = true)] | ||
public sealed partial class Path_With_DashStrokeArray : UserControl | ||
{ | ||
[SampleControlInfo("Path", "Path_With_DashStrokeArray")] | ||
public sealed partial class Path_With_DashStrokeArray : UserControl | ||
public Path_With_DashStrokeArray() | ||
{ | ||
public Path_With_DashStrokeArray() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
this.InitializeComponent(); | ||
} | ||
} |
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
67 changes: 67 additions & 0 deletions
67
src/Uno.UI.Composition/Composition/CompositionStrokeDashArray.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using Uno; | ||
|
||
namespace Microsoft.UI.Composition; | ||
|
||
[NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__MACOS__")] | ||
public partial class CompositionStrokeDashArray : CompositionObject, IList<float>, IEnumerable<float> | ||
{ | ||
private readonly List<float> _list; | ||
|
||
internal CompositionStrokeDashArray() | ||
{ | ||
_list = new List<float>(); | ||
} | ||
|
||
public uint Size => (uint)_list.Count; | ||
|
||
public int IndexOf(float item) | ||
=> _list.IndexOf(item); | ||
|
||
public void Insert(int index, float item) | ||
=> _list.Insert(index, item); | ||
|
||
public void RemoveAt(int index) | ||
=> _list.RemoveAt(index); | ||
|
||
public float this[int index] | ||
{ | ||
get => _list[index]; | ||
set => _list[index] = value; | ||
} | ||
|
||
public void Add(float item) | ||
=> _list.Add(item); | ||
|
||
public void Clear() | ||
=> _list.Clear(); | ||
|
||
public bool Contains(float item) | ||
=> _list.Contains(item); | ||
|
||
public void CopyTo(float[] array, int arrayIndex) | ||
=> _list.CopyTo(array, arrayIndex); | ||
|
||
public bool Remove(float item) | ||
=> _list.Remove(item); | ||
|
||
public int Count | ||
=> _list.Count; | ||
|
||
public bool IsReadOnly | ||
=> false; | ||
|
||
public IEnumerator<float> GetEnumerator() | ||
=> _list.GetEnumerator(); | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
=> _list.GetEnumerator(); | ||
|
||
internal float[] ToEvenArray() | ||
{ | ||
return _list.Count % 2 == 0 | ||
? _list.ToArray() | ||
: [.. _list, .. _list]; | ||
} | ||
} |
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