Skip to content

Commit c3275d3

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.get/set_PathClass ( Fixes #82 )
1 parent 694a1f4 commit c3275d3

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

Turtle.types.ps1xml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,29 @@ foreach ($key in $PathAttribute.Keys) {
14921492
}
14931493
</SetScriptBlock>
14941494
</ScriptProperty>
1495+
<ScriptProperty>
1496+
<Name>PathClass</Name>
1497+
<GetScriptBlock>
1498+
if ($this.'.PathClass') { return $this.'.PathClass'}
1499+
return 'foreground-stroke'
1500+
</GetScriptBlock>
1501+
<SetScriptBlock>
1502+
&lt;#
1503+
.SYNOPSIS
1504+
Sets the turtle path class
1505+
.DESCRIPTION
1506+
Sets the css classes that apply to the turtle path.
1507+
1508+
This property will rarely be set directly, but can be handy for integrating turtle graphics into custom pages.
1509+
#&gt;
1510+
param(
1511+
$PathClass
1512+
)
1513+
1514+
$this | Add-Member -MemberType NoteProperty -Force -Name '.PathClass' -Value @($PathClass)
1515+
1516+
</SetScriptBlock>
1517+
</ScriptProperty>
14951518
<ScriptProperty>
14961519
<Name>PathData</Name>
14971520
<GetScriptBlock>
@@ -1527,7 +1550,9 @@ foreach ($key in $PathAttribute.Keys) {
15271550
if ($this.Stroke) { $this.Stroke } else { 'currentColor' }
15281551
)' stroke-width='$(
15291552
if ($this.StrokeWidth) { $this.StrokeWidth } else { '0.1%' }
1530-
)' fill='$($this.Fill)' class='foreground-stroke'$(
1553+
)' fill='$($this.Fill)' class='$(
1554+
$this.PathClass -join ' '
1555+
)' $(
15311556
foreach ($pathAttributeName in $this.PathAttribute.Keys) {
15321557
" $pathAttributeName='$($this.PathAttribute[$pathAttributeName])'"
15331558
}

0 commit comments

Comments
 (0)