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

datasets for sketches

This commit is contained in:
Pomax
2020-08-24 23:20:25 -07:00
parent 4f823cf856
commit 22ffc4b6c2
107 changed files with 5474 additions and 23516 deletions

View File

@@ -138,6 +138,19 @@ class GraphicsAPI extends BaseAPI {
points.forEach((p) => this.movable.push(p));
}
/**
* Get a parameter specified via data-attribute
*/
getParameter(name, fallback) {
let val = this.dataset[name];
if (val) {
let asFloat = parseFloat(val);
if (val == asFloat) return asFloat;
return val;
}
return fallback;
}
/**
* Set up a slider to control a named, numerical property in the sketch.
*