diff options
author | Jonathan Duran | 2012-03-30 10:27:54 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-03-30 10:27:54 -0700 |
commit | 7bcc6c6873778a19afb5b7f77e5b7e2e8deedd94 (patch) | |
tree | fbb26ddd8d8edceea991866de0114180cd0bdb26 /js/tools/PenTool.js | |
parent | aa9d13bb03f9fdc090bbf78c10ed8d5c79895019 (diff) | |
parent | f4949cab544886702e7ad6eeaa6215125c7b067a (diff) | |
download | ninja-7bcc6c6873778a19afb5b7f77e5b7e2e8deedd94.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'js/tools/PenTool.js')
-rwxr-xr-x | js/tools/PenTool.js | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 60ef4f92..779b7f16 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -467,9 +467,9 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
467 | if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){ | 467 | if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){ |
468 | this._selectedSubpath.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor); | 468 | this._selectedSubpath.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor); |
469 | } | 469 | } |
470 | //if (this.application.ninja.colorController.colorToolbar.fill.webGlColor){ | 470 | if (this.application.ninja.colorController.colorToolbar.fill.webGlColor){ |
471 | // this._selectedSubpath.setFillColor(this.application.ninja.colorController.colorToolbar.fill.webGlColor); | 471 | this._selectedSubpath.setFillColor(this.application.ninja.colorController.colorToolbar.fill.webGlColor); |
472 | //} | 472 | } |
473 | } //if this is a new path being rendered | 473 | } //if this is a new path being rendered |
474 | 474 | ||
475 | this._selectedSubpath.makeDirty(); | 475 | this._selectedSubpath.makeDirty(); |
@@ -594,6 +594,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
594 | 594 | ||
595 | var subpath = this._selectedSubpath; //new GLSubpath(); | 595 | var subpath = this._selectedSubpath; //new GLSubpath(); |
596 | subpath.setWorld(world); | 596 | subpath.setWorld(world); |
597 | subpath.setCanvas(newCanvas); | ||
597 | subpath.setPlaneMatrix(planeMat); | 598 | subpath.setPlaneMatrix(planeMat); |
598 | var planeMatInv = glmat4.inverse( planeMat, [] ); | 599 | var planeMatInv = glmat4.inverse( planeMat, [] ); |
599 | subpath.setPlaneMatrixInverse(planeMatInv); | 600 | subpath.setPlaneMatrixInverse(planeMatInv); |
@@ -601,7 +602,33 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
601 | 602 | ||
602 | world.addObject(subpath); | 603 | world.addObject(subpath); |
603 | world.render(); | 604 | world.render(); |
605 | //TODO this will not work if there are multiple shapes in the same canvas | ||
604 | newCanvas.elementModel.shapeModel.GLGeomObj = subpath; | 606 | newCanvas.elementModel.shapeModel.GLGeomObj = subpath; |
607 | newCanvas.elementModel.shapeModel.shapeCount++; | ||
608 | if(newCanvas.elementModel.shapeModel.shapeCount === 1) | ||
609 | { | ||
610 | newCanvas.elementModel.selection = "Subpath"; | ||
611 | newCanvas.elementModel.pi = "SubpathPi"; | ||
612 | newCanvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; | ||
613 | var strokeColor = subpath.getStrokeColor(); | ||
614 | newCanvas.elementModel.shapeModel.stroke = strokeColor; | ||
615 | if(strokeColor) { | ||
616 | newCanvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; | ||
617 | } | ||
618 | newCanvas.elementModel.shapeModel.strokeMaterial = subpath.getStrokeMaterial(); | ||
619 | |||
620 | newCanvas.elementModel.shapeModel.GLGeomObj = subpath; | ||
621 | newCanvas.elementModel.shapeModel.useWebGl = this.options.use3D; | ||
622 | } | ||
623 | else | ||
624 | { | ||
625 | // TODO - update the shape's info only. shapeModel will likely need an array of shapes. | ||
626 | } | ||
627 | |||
628 | if(newCanvas.elementModel.isShape) | ||
629 | { | ||
630 | this.application.ninja.selectionController.selectElement(newCanvas); | ||
631 | } | ||
605 | } //if (!canvas) { | 632 | } //if (!canvas) { |
606 | else { | 633 | else { |
607 | 634 | ||