1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-30 11:40:27 +02:00
This commit is contained in:
Pomax
2016-01-03 17:08:58 -08:00
parent fe9749d5c1
commit 8b78e22ac4
2 changed files with 18 additions and 14 deletions

View File

@@ -16,13 +16,15 @@ var Canonical = React.createClass({
},
draw: function(api, curve) {
var w = 400,
h = w,
unit = this.unit,
center = {x:w/2, y:h/2};
api.setSize(w,h);
api.setPanelCount(2);
api.reset();
var w = api.getPanelWidth(),
h = api.getPanelHeight(),
unit = this.unit;
api.drawSkeleton(curve);
api.drawCurve(curve);
@@ -38,7 +40,6 @@ var Canonical = React.createClass({
];
var canonical = new api.Bezier(npts);
var center = {x:w/2, y:h/2};
api.setColor("blue");
api.drawCurve(canonical, center);
api.drawCircle(npts[3], 3, center);
@@ -65,6 +66,7 @@ var Canonical = React.createClass({
h = w,
unit = this.unit = w/5,
center = {x:w/2, y:h/2};
api.setSize(w,h);
// axes + gridlines