Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
cec5bd6
Added the Win2d Path Geometry parser.
ratishphilip Sep 26, 2020
298d22f
Merge branch 'master' into feature/win2dparser
ratishphilip Sep 29, 2020
36c5617
Merge branch 'master' into feature/win2dparser
ratishphilip Oct 15, 2020
34306d7
Merge branch 'master' into feature/win2dparser
ratishphilip Oct 21, 2020
d6d39de
Added unit test cases for Geometry Helpers.
ratishphilip Dec 16, 2020
983a3ce
Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
ratishphilip Dec 16, 2020
609e249
updated SampleApp.csproj file to resolve conflict
ratishphilip Dec 16, 2020
7f8162a
Merge branch 'master' into feature/win2dparser
ratishphilip Dec 16, 2020
0daee1e
Updated headers.
ratishphilip Dec 16, 2020
d8e1753
Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
ratishphilip Dec 16, 2020
1ec440a
Fixed build errors. Removed unused usings.
ratishphilip Dec 16, 2020
16db83d
Merge branch 'master' into feature/win2dparser
ratishphilip Dec 18, 2020
155dc64
Merge branch 'master' into feature/win2dparser
ratishphilip Dec 18, 2020
874579c
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 3, 2021
7360ed9
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 7, 2021
d82454d
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 9, 2021
46e88b1
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 12, 2021
b61a631
Implemented changes based on Sergio's review comments.
ratishphilip Jan 17, 2021
78720bc
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 17, 2021
d26c3ec
Fixed build errors. (Added default option for switch case)
ratishphilip Jan 17, 2021
3b69aed
Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
ratishphilip Jan 17, 2021
cba88e9
Removed ThrowHelper.ThrowNullReferenceException which I had added.
ratishphilip Jan 18, 2021
f419f2c
Using ThrowHelper.ThrowArgument exception instead of ThrowHelper.Thro…
ratishphilip Jan 18, 2021
31eeae1
Implemented Xamllama's severl code review comments.
ratishphilip Jan 18, 2021
8a195a1
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 19, 2021
42f9b5c
Added more TestCases as per code review comments.
ratishphilip Jan 20, 2021
693ddf7
Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
ratishphilip Jan 20, 2021
16fb788
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 20, 2021
30a5040
Removed logger from CanvasPathGeometry. Using ICanvasPathReceiver in …
ratishphilip Jan 22, 2021
c3a31f3
Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
ratishphilip Jan 22, 2021
530e722
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 22, 2021
37a70ef
Parsing CanvasGeometry on Input change.
ratishphilip Jan 22, 2021
d61d202
Csproj fixes
ratishphilip Jan 22, 2021
eb7d40d
SampleApp.csproj build failure fix.
ratishphilip Jan 22, 2021
7d756c5
Build error fix.
ratishphilip Jan 22, 2021
6c63198
Merge branch 'master' into feature/win2dparser
michael-hawker Jan 22, 2021
e618fc7
CanvasGeometry path parse error now more descriptive in the Sample App.
ratishphilip Jan 22, 2021
b7a9fed
Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
ratishphilip Jan 22, 2021
be42cc5
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 27, 2021
ef27c15
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 28, 2021
46d93c0
Merge branch 'master' into feature/win2dparser
ratishphilip Jan 29, 2021
3e55f52
Sample app now switches to Commands List pivot item to show the parsi…
ratishphilip Jan 30, 2021
2f6f192
Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
ratishphilip Jan 30, 2021
90f1cb7
Merge branch 'master' into feature/win2dparser
ratishphilip Feb 2, 2021
67e3842
Merge branch 'master' into feature/win2dparser
Sergio0694 Feb 4, 2021
4bafb55
Refactored removed Diagnostics dependency
Sergio0694 Feb 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
PlaceholderText="Enter SVG/XAML Path Data and press Parse. (Or click on one of the Samples from above)"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectionHighlightColor="#007aff"
Text="{x:Bind InputText, Mode=TwoWay}"
Text="{Binding InputText, Mode=TwoWay}"
TextChanged="{x:Bind OnInputTextChanged}"
TextWrapping="Wrap" />
<Button Grid.Row="3"
Width="120"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Windows.System;
using Microsoft.Graphics.Canvas.Geometry;
using Microsoft.Graphics.Canvas.UI.Xaml;
using Microsoft.Toolkit.Uwp.UI.Media.Geometry;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Microsoft.Toolkit.Uwp.UI.Extensions;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
Expand All @@ -21,14 +23,20 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
/// </summary>
public sealed partial class CanvasPathGeometryPage : Page
{
private const string Sample1 = "F0 M 656.500,400.500 C 656.500,350.637 598.572,307.493 514.292,286.708 C 493.507,202.428 450.363,144.500 400.500,144.500 C 350.637,144.500 307.493,202.428 286.708,286.708 C 202.428,307.493 144.500,350.637 144.500,400.500 C 144.500,450.363 202.428,493.507 286.708,514.292 C 307.493,598.572 350.637,656.500 400.500,656.500 C 450.363,656.500 493.507,598.572 514.292,514.292 C 598.572,493.507 656.500,450.363 656.500,400.500 ZM 581.519,219.481 C 546.261,184.222 474.793,194.676 400.500,239.574 C 326.207,194.676 254.739,184.222 219.481,219.481 C 184.222,254.739 194.676,326.207 239.574,400.500 C 194.676,474.792 184.222,546.261 219.481,581.519 C 254.739,616.778 326.207,606.324 400.500,561.426 C 474.793,606.324 546.261,616.778 581.519,581.519 C 616.778,546.261 606.324,474.792 561.426,400.500 C 606.324,326.207 616.778,254.739 581.519,219.481 ZU 112.5 112.5 570 570 36 36";
private const string Sample1 =
"F0 M 656.500,400.500 C 656.500,350.637 598.572,307.493 514.292,286.708 C 493.507,202.428 450.363,144.500 400.500,144.500 C 350.637,144.500 307.493,202.428 286.708,286.708 C 202.428,307.493 144.500,350.637 144.500,400.500 C 144.500,450.363 202.428,493.507 286.708,514.292 C 307.493,598.572 350.637,656.500 400.500,656.500 C 450.363,656.500 493.507,598.572 514.292,514.292 C 598.572,493.507 656.500,450.363 656.500,400.500 ZM 581.519,219.481 C 546.261,184.222 474.793,194.676 400.500,239.574 C 326.207,194.676 254.739,184.222 219.481,219.481 C 184.222,254.739 194.676,326.207 239.574,400.500 C 194.676,474.792 184.222,546.261 219.481,581.519 C 254.739,616.778 326.207,606.324 400.500,561.426 C 474.793,606.324 546.261,616.778 581.519,581.519 C 616.778,546.261 606.324,474.792 561.426,400.500 C 606.324,326.207 616.778,254.739 581.519,219.481 ZU 112.5 112.5 570 570 36 36";

private const string Sample2 =
"F1 M 331.341,81.975 L 398.766,218.593 L 549.533,240.500 L 440.437,346.842 L 466.191,497.000 L 331.341,426.105 L 196.491,497.000 L 222.245,346.842 L 113.150,240.500 L 263.916,218.593 L 331.341,81.975 Z";

private const string Sample3 = "F1 M 545.497,397.058 C 454.492,512.882 286.824,533.003 171.000,441.998 C 78.340,369.194 62.244,235.059 135.048,142.400 C 193.291,68.272 300.599,55.395 374.726,113.639 C 434.028,160.233 444.330,246.079 397.736,305.381 C 360.460,352.823 291.783,361.064 244.341,323.788 C 206.388,293.968 199.795,239.026 229.616,201.073 C 253.472,170.711 297.425,165.436 327.788,189.293 C 352.078,208.378 356.297,243.540 337.212,267.830 C 321.944,287.262 293.814,290.638 274.382,275.370 C 258.836,263.155 256.136,240.651 268.350,225.106 C 278.122,212.669 296.125,210.509 308.562,220.280 C 318.511,228.098 320.239,242.500 312.422,252.449";
private const string Sample4 = "F1 M 311.717,332.110 C 285.669,332.110 264.552,310.994 264.552,284.945 C 264.552,258.897 285.669,237.781 311.717,237.781 C 337.765,237.781 358.881,258.897 358.881,284.945 C 358.881,310.994 337.765,332.110 311.717,332.110 Z M 505.712,232.846 C 634.939,203.833 411.705,171.395 371.772,213.383 C 411.705,171.395 311.872,-30.889 311.872,92.013 C 311.872,-30.889 212.038,171.395 251.972,213.383 C 212.038,171.395 -11.196,203.833 118.031,232.846 C -11.196,203.833 150.338,361.289 214.951,327.320 C 150.338,361.289 112.205,583.622 192.072,460.719 C 112.205,583.622 311.872,478.651 311.872,397.737 C 311.872,478.651 511.538,583.622 431.672,460.719 C 511.538,583.622 473.405,361.289 408.792,327.320 C 473.405,361.289 634.939,203.833 505.712,232.846 Z";
private const string Sample5 = "F1 M 391.853,348.284 C 391.853,357.113 384.696,364.271 375.867,364.271 L 301.927,364.271 C 293.098,364.271 285.940,357.113 285.940,348.284 L 285.940,274.345 C 285.940,265.515 293.098,258.358 301.927,258.358 L 375.867,258.358 C 384.696,258.358 391.853,265.515 391.853,274.345 L 391.853,348.284 Z M 544.748,282.990 L 485.488,267.081 C 472.521,263.600 466.301,248.839 472.866,237.128 L 502.867,183.604 C 512.642,166.166 494.336,146.433 476.214,154.872 L 420.592,180.776 C 408.421,186.445 394.169,179.136 391.670,165.944 L 380.248,105.658 C 376.526,86.017 349.819,82.667 341.362,100.780 L 315.403,156.378 C 309.723,168.543 294.107,172.105 283.714,163.607 L 236.213,124.767 C 220.737,112.113 198.125,126.714 203.289,146.025 L 219.141,205.301 C 222.610,218.271 212.937,231.038 199.512,231.208 L 138.159,231.988 C 118.170,232.242 110.233,257.962 126.602,269.436 L 176.847,304.655 C 187.841,312.361 188.638,328.358 178.464,337.118 L 131.965,377.153 C 116.816,390.196 127.269,415.001 147.184,413.268 L 208.312,407.950 C 221.687,406.786 232.580,418.529 230.417,431.779 L 220.531,492.336 C 217.310,512.066 241.261,524.348 255.403,510.220 L 298.811,466.854 C 308.310,457.365 324.202,459.358 331.062,470.899 L 362.415,523.643 C 372.629,540.827 398.872,534.840 400.624,514.927 L 406.001,453.804 C 407.178,440.430 420.634,431.742 433.307,436.173 L 491.227,456.425 C 510.098,463.022 526.353,441.568 514.895,425.187 L 479.725,374.908 C 472.030,363.906 476.753,348.601 489.310,343.850 L 546.697,322.133 C 565.393,315.057 564.054,288.173 544.748,282.990 Z";
private const string Sample3 =
"F1 M 545.497,397.058 C 454.492,512.882 286.824,533.003 171.000,441.998 C 78.340,369.194 62.244,235.059 135.048,142.400 C 193.291,68.272 300.599,55.395 374.726,113.639 C 434.028,160.233 444.330,246.079 397.736,305.381 C 360.460,352.823 291.783,361.064 244.341,323.788 C 206.388,293.968 199.795,239.026 229.616,201.073 C 253.472,170.711 297.425,165.436 327.788,189.293 C 352.078,208.378 356.297,243.540 337.212,267.830 C 321.944,287.262 293.814,290.638 274.382,275.370 C 258.836,263.155 256.136,240.651 268.350,225.106 C 278.122,212.669 296.125,210.509 308.562,220.280 C 318.511,228.098 320.239,242.500 312.422,252.449";

private const string Sample4 =
"F1 M 311.717,332.110 C 285.669,332.110 264.552,310.994 264.552,284.945 C 264.552,258.897 285.669,237.781 311.717,237.781 C 337.765,237.781 358.881,258.897 358.881,284.945 C 358.881,310.994 337.765,332.110 311.717,332.110 Z M 505.712,232.846 C 634.939,203.833 411.705,171.395 371.772,213.383 C 411.705,171.395 311.872,-30.889 311.872,92.013 C 311.872,-30.889 212.038,171.395 251.972,213.383 C 212.038,171.395 -11.196,203.833 118.031,232.846 C -11.196,203.833 150.338,361.289 214.951,327.320 C 150.338,361.289 112.205,583.622 192.072,460.719 C 112.205,583.622 311.872,478.651 311.872,397.737 C 311.872,478.651 511.538,583.622 431.672,460.719 C 511.538,583.622 473.405,361.289 408.792,327.320 C 473.405,361.289 634.939,203.833 505.712,232.846 Z";

private const string Sample5 =
"F1 M 391.853,348.284 C 391.853,357.113 384.696,364.271 375.867,364.271 L 301.927,364.271 C 293.098,364.271 285.940,357.113 285.940,348.284 L 285.940,274.345 C 285.940,265.515 293.098,258.358 301.927,258.358 L 375.867,258.358 C 384.696,258.358 391.853,265.515 391.853,274.345 L 391.853,348.284 Z M 544.748,282.990 L 485.488,267.081 C 472.521,263.600 466.301,248.839 472.866,237.128 L 502.867,183.604 C 512.642,166.166 494.336,146.433 476.214,154.872 L 420.592,180.776 C 408.421,186.445 394.169,179.136 391.670,165.944 L 380.248,105.658 C 376.526,86.017 349.819,82.667 341.362,100.780 L 315.403,156.378 C 309.723,168.543 294.107,172.105 283.714,163.607 L 236.213,124.767 C 220.737,112.113 198.125,126.714 203.289,146.025 L 219.141,205.301 C 222.610,218.271 212.937,231.038 199.512,231.208 L 138.159,231.988 C 118.170,232.242 110.233,257.962 126.602,269.436 L 176.847,304.655 C 187.841,312.361 188.638,328.358 178.464,337.118 L 131.965,377.153 C 116.816,390.196 127.269,415.001 147.184,413.268 L 208.312,407.950 C 221.687,406.786 232.580,418.529 230.417,431.779 L 220.531,492.336 C 217.310,512.066 241.261,524.348 255.403,510.220 L 298.811,466.854 C 308.310,457.365 324.202,459.358 331.062,470.899 L 362.415,523.643 C 372.629,540.827 398.872,534.840 400.624,514.927 L 406.001,453.804 C 407.178,440.430 420.634,431.742 433.307,436.173 L 491.227,456.425 C 510.098,463.022 526.353,441.568 514.895,425.187 L 479.725,374.908 C 472.030,363.906 476.753,348.601 489.310,343.850 L 546.697,322.133 C 565.393,315.057 564.054,288.173 544.748,282.990 Z";

private const string ErrorString =
"F1 M 19.648,24.605 L 19.648,30.220 L 29.404,30.220 L 29.404,28.149 C 29.404,27.229 29.581,26.573 29.936,26.181 C 30.290,25.790 30.753,25.594 31.325,25.594 C 31.885,25.594 " +
Expand Down Expand Up @@ -70,6 +78,8 @@ public sealed partial class CanvasPathGeometryPage : Page
"135.021,11.529 135.313,10.749 135.898,10.158 C 136.482,9.567 137.210,9.272 138.080,9.272 C 138.938,9.272 139.662,9.570 140.253,10.167 C 140.844,10.764 141.139,11.516 141.139,12.424 " +
"C 141.139,12.611 141.108,13.021 141.046,13.655 Z";

private DispatcherQueueTimer _typeTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();

private List<Color> _colors;
private List<string> _samples;

Expand Down Expand Up @@ -264,5 +274,15 @@ private void OnShowGearSample(object sender, RoutedEventArgs e)
{
ShowSample(5);
}

public void OnInputTextChanged(object sender, RoutedEventArgs e)
{
_typeTimer.Debounce(
() =>
{
// Only executes this code after 0.3 seconds have elapsed since last trigger.
this.OnParseData(null, null);
}, TimeSpan.FromSeconds(0.3));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@

<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit\Microsoft.Toolkit.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Animations\Microsoft.Toolkit.Uwp.UI.Animations.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion UITests/UITests.App/UITests.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@
</Target>
-->
<Import Project="..\UITests.Tests.Shared\UITests.Tests.Shared.projitems" Label="Shared" />
</Project>
</Project>
4 changes: 4 additions & 0 deletions UnitTests/UnitTests.UWP/UnitTests.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@
<Project>{b1e850ff-dde6-44d5-a830-34250e97a687}</Project>
<Name>Microsoft.Toolkit.Uwp.Connectivity</Name>
</ProjectReference>
<ProjectReference Include="..\..\Microsoft.Toolkit.Uwp.UI.Animations\Microsoft.Toolkit.Uwp.UI.Animations.csproj">
<Project>{b24a296c-b3eb-4e06-a64e-74ac2d1acc91}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Animations</Name>
</ProjectReference>
<ProjectReference Include="..\..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj">
<Project>{e9faabfb-d726-42c1-83c1-cb46a29fea81}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls</Name>
Expand Down