File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -2136,6 +2136,43 @@ $b64 = [Convert]::ToBase64String($OutputEncoding.GetBytes($thisSymbol.outerXml))
21362136"data:image/svg+xml;base64,$b64"
21372137 </GetScriptBlock >
21382138 </ScriptProperty >
2139+ <ScriptProperty >
2140+ <Name >Duration</Name >
2141+ <GetScriptBlock >
2142+ < #
2143+ .SYNOPSIS
2144+ Gets the duration
2145+ .DESCRIPTION
2146+ Gets the default duration of animations and morphs.
2147+ #>
2148+ if ($this.'.Duration') { return $this.'.Duration'}
2149+ return
2150+ </GetScriptBlock >
2151+ <SetScriptBlock >
2152+ < #
2153+ .SYNOPSIS
2154+ Sets the duration
2155+ .DESCRIPTION
2156+ Sets the default duration used for morphs and other animations.
2157+ #>
2158+ param(
2159+ # The value to set
2160+ $value
2161+ )
2162+
2163+ foreach ($v in $value) {
2164+ if ($v -is [Timespan]) {
2165+ $this | Add-Member NoteProperty '.Duration' $v -Force
2166+ } elseif ($v -is [double] -or $v -is [int]) {
2167+ $this | Add-Member NoteProperty '.Duration' ([TimeSpan]::FromSeconds($v)) -Force
2168+ } else {
2169+ Write-Warning "'$Value' is not a number or timespan"
2170+ }
2171+ }
2172+
2173+
2174+ </SetScriptBlock >
2175+ </ScriptProperty >
21392176 <ScriptProperty >
21402177 <Name >Fill</Name >
21412178 <GetScriptBlock >
@@ -2491,6 +2528,11 @@ $newAnimation = @(foreach ($animation in $PathAnimation) {
24912528 if ($animationCopy['attributeName'] -eq 'transform') {
24922529 $elementName = 'animateTransform'
24932530 }
2531+
2532+
2533+ if (-not $animationCopy['dur'] -and $this.Duration) {
2534+ $animationCopy['dur'] = "$($this.Duration.TotalSeconds)s"
2535+ }
24942536
24952537 "< $elementName $(
24962538 @(foreach ($key in $animationCopy.Keys) {
You can’t perform that action at this time.
0 commit comments