1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-01 20:33:34 +02:00

fixing some errors to make the build pass

This commit is contained in:
Pomax
2017-03-20 18:42:49 -07:00
parent 046d04d0c5
commit 7eda923398
8 changed files with 99397 additions and 60 deletions

View File

@@ -16,21 +16,26 @@ module.exports = {
api.drawSkeleton(curve);
api.drawCurve(curve);
var tf = curve.order + 1,
var tf = curve.order,
pad = 20,
pts = curve.points,
w = api.getPanelWidth(),
wp = w - 2 * pad,
h = api.getPanelHeight(),
offset = { x: w, y: 0 };
var x_pts = JSON.parse(JSON.stringify(pts)).map((p,t) => { return {x:w*t/tf, y:p.x}; });
var x_pts = JSON.parse(JSON.stringify(pts)).map((p,t) => {
return {x:wp*t/tf, y:p.x};
});
api.drawLine({x:0,y:0}, {x:0,y:h}, offset);
api.drawAxes(pad, "t",0,1, "x",0,w, offset);
offset.x += pad;
api.drawCurve(new api.Bezier(x_pts), offset);
offset.x += w-pad;
var y_pts = JSON.parse(JSON.stringify(pts)).map((p,t) => { return {x:w*t/tf, y:p.y}; });
var y_pts = JSON.parse(JSON.stringify(pts)).map((p,t) => {
return {x:wp*t/tf, y:p.y};
});
api.drawLine({x:0,y:0}, {x:0,y:h}, offset);
api.drawAxes(pad, "t",0,1, "y",0,w, offset);
offset.x += pad;

View File

@@ -1,3 +1,3 @@
var handler = require("./handler.js");
var generateBase = require("../../generate-base");
module.exports = generateBase("graduatedoffset", handler);
module.exports = generateBase("inflections", handler);