Skip to content

Commit 694a1f4

Browse files
feat: Turtle.get/set_PathClass ( Fixes #82 )
1 parent 704a2b4 commit 694a1f4

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Types/Turtle/get_PathClass.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if ($this.'.PathClass') { return $this.'.PathClass'}
2+
return 'foreground-stroke'

Types/Turtle/get_PathElement.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
if ($this.Stroke) { $this.Stroke } else { 'currentColor' }
44
)' stroke-width='$(
55
if ($this.StrokeWidth) { $this.StrokeWidth } else { '0.1%' }
6-
)' fill='$($this.Fill)' class='foreground-stroke'$(
6+
)' fill='$($this.Fill)' class='$(
7+
$this.PathClass -join ' '
8+
)' $(
79
foreach ($pathAttributeName in $this.PathAttribute.Keys) {
810
" $pathAttributeName='$($this.PathAttribute[$pathAttributeName])'"
911
}

Types/Turtle/set_PathClass.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<#
2+
.SYNOPSIS
3+
Sets the turtle path class
4+
.DESCRIPTION
5+
Sets the css classes that apply to the turtle path.
6+
7+
This property will rarely be set directly, but can be handy for integrating turtle graphics into custom pages.
8+
#>
9+
param(
10+
$PathClass
11+
)
12+
13+
$this | Add-Member -MemberType NoteProperty -Force -Name '.PathClass' -Value @($PathClass)

0 commit comments

Comments
 (0)