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