@@ -1755,6 +1755,53 @@ $this.PathAttribute = [Ordered]@{'opacity' = $Opacity}
1755
1755
1756
1756
</SetScriptBlock >
1757
1757
</ScriptProperty >
1758
+ <ScriptProperty >
1759
+ <Name >PathAnimation</Name >
1760
+ <GetScriptBlock >
1761
+ if ($this.'.PathAnimation') {
1762
+ return $this.'.PathAnimation'
1763
+ }
1764
+
1765
+ </GetScriptBlock >
1766
+ <SetScriptBlock >
1767
+ param(
1768
+ [PSObject]
1769
+ $PathAnimation
1770
+ )
1771
+
1772
+ $newAnimation = @(foreach ($animation in $PathAnimation) {
1773
+ if ($animation -is [Collections.IDictionary]) {
1774
+ $animationCopy = [Ordered]@{} + $animation
1775
+ if (-not $animationCopy['attributeType']) {
1776
+ $animationCopy['attributeType'] = 'XML'
1777
+ }
1778
+ if (-not $animationCopy['attributeName']) {
1779
+ $animationCopy['attributeName'] = 'transform'
1780
+ }
1781
+ if ($animationCopy.values -is [object[]]) {
1782
+ $animationCopy['values'] = $animationCopy['values'] -join ';'
1783
+ }
1784
+
1785
+ $elementName = 'animate'
1786
+ if ($animationCopy['attributeName'] -eq 'transform') {
1787
+ $elementName = 'animateTransform'
1788
+ }
1789
+
1790
+ "< $elementName $(
1791
+ @(foreach ($key in $animationCopy.Keys) {
1792
+ " $key='$([Web.HttpUtility]::HtmlAttributeEncode($animationCopy[$key]))'"
1793
+ }) -join ''
1794
+ )/> "
1795
+ }
1796
+ if ($animation -is [string]) {
1797
+ $animation
1798
+ }
1799
+ })
1800
+
1801
+ $this | Add-Member -MemberType NoteProperty -Force -Name '.PathAnimation' -Value $newAnimation
1802
+
1803
+ </SetScriptBlock >
1804
+ </ScriptProperty >
1758
1805
<ScriptProperty >
1759
1806
<Name >PathAttribute</Name >
1760
1807
<GetScriptBlock >
@@ -1837,11 +1884,13 @@ $this | Add-Member -MemberType NoteProperty -Force -Name '.PathClass' -Value @(
1837
1884
if ($this.StrokeWidth) { $this.StrokeWidth } else { '0.1%' }
1838
1885
)' fill='$($this.Fill)' class='$(
1839
1886
$this.PathClass -join ' '
1840
- )' $(
1887
+ )' transform-origin='50% 50%' $(
1841
1888
foreach ($pathAttributeName in $this.PathAttribute.Keys) {
1842
1889
" $pathAttributeName='$($this.PathAttribute[$pathAttributeName])'"
1843
1890
}
1844
- ) /> "
1891
+ )> "
1892
+ if ($this.PathAnimation) {$this.PathAnimation}
1893
+ "< /path> "
1845
1894
) -as [xml]
1846
1895
</GetScriptBlock >
1847
1896
</ScriptProperty >
0 commit comments