File tree Expand file tree Collapse file tree 3 files changed +17
-17
lines changed
Expand file tree Collapse file tree 3 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 11<#
22. SYNOPSIS
3- Gets the turtle opacity
3+ Gets a Turtle's opacity
44. DESCRIPTION
5- Gets the opacity of the turtle path.
5+ Gets the opacity of a Turtle
6+ . EXAMPLE
7+ turtle opacity .5
68#>
7- if (-not $this .' .PathAttribute' ) {
8- $this | Add-Member - MemberType NoteProperty - Name ' .PathAttribute' - Value ([Ordered ]@ {}) - Force
9- }
10- if ($this .' .PathAttribute' .' opacity' ) {
11- return $this .' .PathAttribute' .' opacity'
12- } else {
13- return 1.0
14- }
9+ param ()
10+ return $this .' .Opacity'
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ $svgAttributes = [Ordered]@{
1515 height = ' 100%'
1616}
1717
18+ # If opacity is set, it should apply to the entire SVG.
19+ if ($null -ne $this.opacity ) {
20+ $svgAttributes [' opacity' ] = $this.opacity
21+ }
22+
1823# If the viewbox would have zero width or height
1924if ($this.ViewBox [-1 ] -eq 0 -or $this.ViewBox [-2 ] -eq 0 ) {
2025 # It's not much of a viewbox at all, and we will omit the attribute.
@@ -73,7 +78,7 @@ $svgElement = @(
7378 " $ ( $this.Style -join (' ;' + [Environment ]::NewLine)) "
7479 }
7580 " </style>"
76- }
81+ }
7782
7883 # Declare any SVG animations
7984 if ($this.SVGAnimation ) {$this.SVGAnimation }
Original file line number Diff line number Diff line change 11<#
22. SYNOPSIS
3- Sets the opacity
3+ Sets a Turtle's opacity
44. DESCRIPTION
5- Sets the opacity of the path
5+ Sets the opacity of a Turtle
66. EXAMPLE
7- turtle forward 100 opacity 0 .5 save ./dimLine.svg
7+ turtle opacity .5 opacity
88#>
99param (
1010[double ]
11- $Opacity = ' nonzero '
11+ $Opacity
1212)
13-
14- $this.PathAttribute = [Ordered ]@ {' opacity' = $Opacity }
13+ $this | Add-Member NoteProperty ' .Opacity' $Opacity - Force
You can’t perform that action at this time.
0 commit comments