Skip to content

Commit 36b78ac

Browse files
chore: Cleaning up whitespace and fixing some examples
1 parent 2b0a2a7 commit 36b78ac

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

Types/Turtle/ArcRight.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ $iteration = $angle / [Math]::Floor($absAngle)
4242
# If we have no step count
4343
if (-not $StepCount) {
4444
# default to half of the angle.
45-
$StepCount = [Math]::Round($absAngle / 2)
45+
$StepCount = [Math]::Round($absAngle / 2)
4646
}
4747
# Turn this into a ratio (by default, this ratio would be `2`).
4848
$stepSize = $absAngle / $StepCount

Types/Turtle/BezierCurve.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
.DESCRIPTION
55
Draws a simple Bezier curve.
66
.EXAMPLE
7-
turtle BezierCurve 0 -100 100 -100 save ./b.svg
7+
turtle BezierCurve 0 -100 100 -100 save ./b1.svg
88
.EXAMPLE
99
turtle BezierCurve 0 -100 100 -100 BezierCurve 100 100 100 100 save ./b2.svg
10-
.EXAMPLE
10+
.EXAMPLE
1111
turtle @(
1212
'BezierCurve', 0, -100, 100, -100
1313
'BezierCurve', 100, 100, 100, 100
@@ -18,7 +18,7 @@
1818
'BezierCurve', 0, -100, 100, -100
1919
'BezierCurve', 100, 100, 100, 100
2020
'BezierCurve', 0, 100, -100, 100
21-
'BezierCurve', -100, -100, -100, -100
21+
'BezierCurve', -100, -100, -100, -100
2222
) save ./b4.svg
2323
.LINK
2424
https://en.wikipedia.org/wiki/B%C3%A9zier_curve
@@ -42,16 +42,15 @@ $DeltaY
4242
)
4343

4444

45-
4645
if ($DeltaX -or $DeltaY) {
47-
$this.Position = $DeltaX, $DeltaY
46+
$this.Position = $DeltaX,$DeltaY
4847
# If the pen is down
4948
if ($this.IsPenDown) {
5049
# draw the curve
51-
$this.Steps.Add("s $ControlX $ControlY $DeltaX $DeltaY")
50+
$this.Steps.Add("s $controlX $controlY $deltaX $deltaY")
5251
} else {
5352
# otherwise, move to the deltaX/deltaY
54-
$this.Steps.Add("m $DeltaX $DeltaY")
53+
$this.Steps.Add("m $deltaX $deltaY")
5554
}
5655
}
5756

Types/Turtle/Step.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ param(
1212
# The DeltaY
1313
[double]$DeltaY = 0
1414
)
15-
1615
# If both coordinates are empty, there is no step
1716
if ($DeltaX -or $DeltaY) {
1817
$this.Position = $DeltaX, $DeltaY

Types/Turtle/Teleport.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $X,
1616
$Y
1717
)
1818

19-
$deltaX = $x - $this.X
19+
$deltaX = $x - $this.X
2020
$deltaY = $y - $this.Y
2121
$penState = $this.IsPenDown
2222
$this.IsPenDown = $false

Types/Turtle/set_MarkerStart.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
If this is set to a string without spaces, it will be be treated as an identifier.
88
.EXAMPLE
9-
turtle viewbox 200 start 50 100 rotate 45 forward 100 markerEnd (
9+
turtle viewbox 200 start 50 100 rotate 45 forward 100 markerStart (
1010
turtle rotate -90 polygon 10 3 fill context-fill stroke context-stroke
1111
) fill '#4488ff' stroke '#224488' strokewidth '3%' save ./marker.svg
1212
.EXAMPLE

Types/Turtle/set_PathAnimation.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ $newAnimation = @(foreach ($animation in $PathAnimation) {
5656
}
5757
})
5858

59-
if ($this.PathAnimation) {
60-
$newAnimation = @($this.PathAnimation) + $newAnimation
59+
$pathAnimation = $this.PathAnimation
60+
if ($pathAnimation) {
61+
$newAnimation = @($pathAnimation) + $newAnimation
6162
}
6263
$this | Add-Member -MemberType NoteProperty -Force -Name '.PathAnimation' -Value $newAnimation
6364

Types/Turtle/set_Position.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ $x, $y = $xy
1515
if (-not $this.'.Position') {
1616
$this | Add-Member -MemberType NoteProperty -Force -Name '.Position' -Value ([Numerics.Vector2]@{ X = 0; Y = 0 })
1717
}
18+
1819
# Modify the position without creating a new object
1920
$this.'.Position'.X += $x
2021
$this.'.Position'.Y += $y

0 commit comments

Comments
 (0)