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

rebuild + sections up to 14

This commit is contained in:
Pomax
2016-01-02 10:05:27 -08:00
parent 15523da391
commit c8ebcf29b9
31 changed files with 3079 additions and 94 deletions

View File

@@ -457,7 +457,27 @@ var Graphic = React.createClass({
offset.y += this.offset.y;
}
this.ctx.fillText(text, offset.x, offset.y);
},
drawAxes: function(pad, xlabel, xs, xe, ylabel, ys, ye, offset) {
offset = offset || { x:0, y:0 };
var dim = this.getPanelWidth();
this.drawLine({x:pad, y:pad}, {x:dim-pad, y:pad}, offset);
this.drawLine({x:pad, y:pad}, {x:pad, y:dim-pad}, offset);
this.setFill("black");
this.text(xlabel + " ", {x: offset.x + dim/2, y: offset.y + 15});
this.text(xs, {x: offset.x + pad, y: offset.y + 15});
this.text(xe, {x: offset.x + dim - pad, y: offset.y + 15});
this.text(ylabel, {x: offset.x + 5, y: offset.y + dim/2 - pad});
this.text("", {x: offset.x + 5, y: offset.y + dim/2});
this.text(ys, {x: offset.x + 4, y: offset.y + pad + 5});
this.text(ye, {x: offset.x + 2, y: offset.y + dim - pad + 10});
}
});
module.exports = Graphic;