1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-27 00:29:00 +02:00

added sliders to sketches that should have one, improved lazy loading

This commit is contained in:
Pomax
2020-08-21 23:39:36 -07:00
parent 65173c10a2
commit ad5da1f088
67 changed files with 833 additions and 643 deletions

View File

@@ -138,6 +138,17 @@ class GraphicsAPI extends BaseAPI {
points.forEach((p) => this.movable.push(p));
}
setSlider(qs, handler, redraw = true) {
let slider = this.find(qs);
if (slider) {
slider.listen(`input`, (evt) => {
handler(parseFloat(evt.target.value));
if (redraw) this.redraw();
});
}
return slider;
}
/**
* Convert the canvas to an image
*/