mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-28 18:49:57 +02:00
figured out how to reuse sketches with data-attribute parameters
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
let curve;
|
||||
|
||||
setup() {
|
||||
this.curve = new Bezier(this, 20, 250, 30, 20, 200, 250, 220, 20);
|
||||
setMovable(this.curve.points);
|
||||
curve = new Bezier(this, 20, 250, 30, 20, 200, 250, 220, 20);
|
||||
setMovable(curve.points);
|
||||
setSlider(`.slide-control`, `position`, 0.5);
|
||||
}
|
||||
|
||||
draw() {
|
||||
resetTransform();
|
||||
clear();
|
||||
const curve = this.curve;
|
||||
|
||||
curve.drawSkeleton();
|
||||
curve.drawCurve();
|
||||
@@ -53,9 +54,3 @@ draw() {
|
||||
line(0, h-x, w, h-x);
|
||||
}
|
||||
}
|
||||
|
||||
onMouseMove() {
|
||||
if (this.cursor.down) {
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user