@@ -5522,34 +5522,29 @@ param()
55225522 <GetScriptBlock >
55235523 < #
55245524.SYNOPSIS
5525- Gets the turtle opacity
5525+ Gets a Turtle's opacity
55265526.DESCRIPTION
5527- Gets the opacity of the turtle path.
5527+ Gets the opacity of a Turtle
5528+ .EXAMPLE
5529+ turtle opacity .5
55285530#>
5529- if (-not $this.'.PathAttribute') {
5530- $this | Add-Member -MemberType NoteProperty -Name '.PathAttribute' -Value ([Ordered]@{}) -Force
5531- }
5532- if ($this.'.PathAttribute'.'opacity') {
5533- return $this.'.PathAttribute'.'opacity'
5534- } else {
5535- return 1.0
5536- }
5531+ param()
5532+ return $this.'.Opacity'
55375533 </GetScriptBlock >
55385534 <SetScriptBlock >
55395535 < #
55405536.SYNOPSIS
5541- Sets the opacity
5537+ Sets a Turtle's opacity
55425538.DESCRIPTION
5543- Sets the opacity of the path
5539+ Sets the opacity of a Turtle
55445540.EXAMPLE
5545- turtle forward 100 opacity 0 .5 save ./dimLine.svg
5541+ turtle opacity .5 opacity
55465542#>
55475543param(
55485544[double]
5549- $Opacity = 'nonzero'
5545+ $Opacity
55505546)
5551-
5552- $this.PathAttribute = [Ordered]@{'opacity' = $Opacity}
5547+ $this | Add-Member NoteProperty '.Opacity' $Opacity -Force
55535548
55545549 </SetScriptBlock >
55555550 </ScriptProperty >
@@ -6532,6 +6527,11 @@ $svgAttributes = [Ordered]@{
65326527 height='100%'
65336528}
65346529
6530+ # If opacity is set, it should apply to the entire SVG.
6531+ if ($null -ne $this.opacity) {
6532+ $svgAttributes['opacity'] = $this.opacity
6533+ }
6534+
65356535# If the viewbox would have zero width or height
65366536if ($this.ViewBox[-1] -eq 0 -or $this.ViewBox[-2] -eq 0) {
65376537 # It's not much of a viewbox at all, and we will omit the attribute.
@@ -6590,7 +6590,7 @@ $svgElement = @(
65906590 "$($this.Style -join (';' + [Environment]::NewLine))"
65916591 }
65926592 "< /style> "
6593- }
6593+ }
65946594
65956595 # Declare any SVG animations
65966596 if ($this.SVGAnimation) {$this.SVGAnimation}
0 commit comments