use _ instead of this

This commit is contained in:
Ladd Hoffman 2024-06-21 20:18:28 -05:00
parent 4091f476ff
commit 83778bb129
2 changed files with 5 additions and 5 deletions

View File

@ -340,9 +340,9 @@ class Drawing {
i += 1;
}
d.definePoint(name, () => {
return (function() {
return (function(_) {
return eval(body);
}).call(d);
})(d);
});
} break;
case 'circle':

View File

@ -10,14 +10,14 @@ caption This is a test
buttons
frame 0 0 200 100
axes 200 100
point p1 this.oscillatingPoint([20, 20], [80, 20], 3000)
point p1 _.oscillatingPoint([20, 20], [80, 20], 3000)
fill cyan
square p1 1000
point p2 [100, 30]
fill red
circle p2
point p3 [ this.oscillatingValue(20, 80, 3000),
this.oscillatingValue(20, 80, 3000, Math.PI/2) ]
point p3 [ _.oscillatingValue(20, 80, 3000),
_.oscillatingValue(20, 80, 3000, Math.PI/2) ]
fill green
circle p3 1000
start