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

paperjs improvement

This commit is contained in:
Pomax
2016-01-11 08:33:07 -08:00
parent 3b8a08c100
commit 98bb8d5a86
4 changed files with 11 additions and 13 deletions

View File

@@ -50,6 +50,7 @@ var Shapes = React.createClass({
new Point(mx-w2 + unit*2, my-h2)
);
path.closePath(true);
path.strokeColor = "rgb(100,100,255)";
return path;
},
@@ -67,19 +68,16 @@ var Shapes = React.createClass({
onMouseMove: function(evt, api) {
var cx = evt.offsetX;
var cy = evt.offsetY;
api.c2.remove();
api.c2 = this.formPath(api, cx, cy);
api.c2.position = {x:cx, y:cy};
},
draw: function(api) {
api.project.clear();
if (api.c3) { api.c3.remove(); }
var c1 = api.c1,
c2 = api.c2,
c3 = c1.unite(c2);
api.project.activeLayer.addChildren([c1,c2,c3]);
c1.strokeColor = "rgb(100,100,255)";
c2.strokeColor = "rgb(100,100,255)";
c3 = api.c3 = c1.unite(c2);
c3.strokeColor = "red";
api.Paper.view.draw();
},
render: function() {