1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-22 16:23:12 +02:00

this rename is absolutely stupid

This commit is contained in:
Pomax
2020-08-20 13:01:32 -07:00
parent 59fdafb2c5
commit d92e370bd1
470 changed files with 22 additions and 9 deletions

View File

@@ -0,0 +1,32 @@
setup() {
this.curve = Bezier.defaultCubic(this);
setMovable(this.curve.points);
const inputs = findAll(`input[type=range]`);
if (inputs) {
const ratios = inputs.map(i => parseFloat(i.value));
this.curve.setRatios(ratios);
inputs.forEach((input,pos) => {
const span = input.nextSibling;
input.listen(`input`, evt => {
const value = parseFloat(evt.target.value);
span.textContent = ratios[pos] = value;
this.curve.update();
this.redraw();
});
})
}
}
draw() {
clear();
const curve = this.curve;
curve.drawSkeleton();
curve.drawCurve();
curve.drawPoints();
}
onMouseMove() {
redraw();
}