Skip to content

Commit 52757ad

Browse files
feat: Turtle.js.get_PathData ( Fixes #318 )
1 parent 0d9e3cd commit 52757ad

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Types/Turtle.js/pathData.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
function pathData() { return `m ${this.min.x * -1} ${this.min.y * -1} ${this.steps.join(' ')} ` }
1+
function get_pathData() {
2+
let startX = 0;
3+
let startY = 0;
4+
if (!this.min) { this.min = { x: 0.0, y: 0.0}}
5+
if (!this.max) { this.max = { x: 0.0, y: 0.0}}
6+
if (this.min.x < 0) {
7+
startX = (this.min.x) * -1
8+
}
9+
if (this.min.y < 0) {
10+
startY = (this.min.y) * -1
11+
}
12+
return `m ${startX} ${startY} ${this.steps?.join(' ')}`
13+
}

0 commit comments

Comments
 (0)