Skip to content

Commit

Permalink
feat: Update WASM Path on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Jul 29, 2020
1 parent 81acc98 commit d06cb5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Uno.UI/UI/Xaml/Shapes/ArbitraryShapeBase.wasm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ partial class ArbitraryShapeBase

private Size GetActualSize() => Size.Empty;

protected virtual void InvalidateShape() { }

protected override Size MeasureOverride(Size availableSize)
{
// We make sure to invoke native methods while not in the visual tree
Expand All @@ -30,6 +32,8 @@ protected override Size MeasureOverride(Size availableSize)
return new Size();
}

InvalidateShape();

var measurements = GetMeasurements(availableSize);
var desiredSize = measurements.desiredSize;

Expand Down
5 changes: 4 additions & 1 deletion src/Uno.UI/UI/Xaml/Shapes/Path.wasm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ protected override SvgElement GetMainSvgElement()
return _path;
}

partial void OnDataChanged()
partial void OnDataChanged() => InvalidateMeasure();

protected override void InvalidateShape()
{
switch (Data)
{
Expand All @@ -43,6 +45,7 @@ partial void OnDataChanged()
break;
}
}

/// <summary>
/// Transform the figures collection into a SVG Path according to :
/// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d
Expand Down

0 comments on commit d06cb5b

Please sign in to comment.