mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-22 00:07:10 +02:00
code comments
This commit is contained in:
@@ -3,9 +3,15 @@ let curve, ratios=[1, 1, 1, 1];
|
||||
setup() {
|
||||
curve = Bezier.defaultCubic(this);
|
||||
setMovable(curve.points);
|
||||
curve.points.forEach((p,i) => {
|
||||
for (let i=0; i<4; i++) {
|
||||
// Set up a slider, but in a way that does not tie it to a variable
|
||||
// that is exposed through `this`, because we want to store its value
|
||||
// in the "ratios" array we already declared globally.
|
||||
//
|
||||
// To make that happen, we tell the slider logic that it should be
|
||||
// calling the setRatio function instead when the slider moves.
|
||||
setSlider(`.ratio-${i+1}`, `!ratio-${i+1}`, 1, v => this.setRatio(i,v))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setRatio(i, v) {
|
||||
|
Reference in New Issue
Block a user