1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-31 03:59:58 +02:00

some polish

This commit is contained in:
Pomax
2020-09-11 16:30:05 -07:00
parent ebe69a732a
commit 046b1024fa
371 changed files with 17445 additions and 58625 deletions

View File

@@ -1,34 +0,0 @@
var ratios;
module.exports = {
drawCubic: function(api) {
var curve = new api.Bezier(
120, 160,
35, 200,
220, 260,
220, 40
);
api.setCurve(curve);
},
drawCurve: function(api, curve) {
api.reset();
api.drawSkeleton(curve);
api.drawCurve(curve);
},
setRatio: function(api, values) {
ratios = values;
this.update(api);
},
changeRatio: function(api, value, pos) {
ratios[pos] = parseFloat(value) || 0.00001;
this.update(api);
},
update: function(api) {
api.curve.setRatios(ratios.slice());
this.drawCurve(api, api.curve);
}
};