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-08 16:10:39 -08:00
parent fba01ea536
commit b4910017ac
31 changed files with 3933 additions and 73 deletions

View File

@@ -343,6 +343,28 @@ var Graphic = React.createClass({
}
},
drawGrid: function(xcount, ycount, offset) {
var w = this.defaultWidth,
h = this.defaultHeight,
xstep = w/xcount,
ox = xstep/2,
ystep = h/ycount,
oy = ystep/2,
x, xv, y, yv, p1, p2;
for (x=0; x<xcount; x++) {
xv = ox + (x*xstep);
p1 = {x:xv, y:0};
p2 = {x:xv, y:h};
this.drawLine(p1, p2, offset);
}
for (y=0; y<ycount; y++) {
yv = oy + (y*ystep);
p1 = {x:0, y:yv};
p2 = {x:w, y:yv};
this.drawLine(p1, p2, offset);
}
},
drawHull: function(curve, t, offset) {
var hull = typeof curve === "array" ? curve : curve.hull(t);
if(hull.length === 6) {