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:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user