diff options
Diffstat (limited to 'js/tools/PenTool.js')
-rwxr-xr-x | js/tools/PenTool.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index f1c79153..962f178d 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -447,7 +447,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
447 | var newCanvas = null; | 447 | var newCanvas = null; |
448 | newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); | 448 | newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); |
449 | var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas); | 449 | var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas); |
450 | ElementMediator.addElement(newCanvas, elementModel.data, true); | 450 | ElementMediator.addElements(newCanvas, elementModel.data, false); |
451 | 451 | ||
452 | // create all the GL stuff | 452 | // create all the GL stuff |
453 | var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial); | 453 | var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial); |
@@ -700,6 +700,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
700 | } | 700 | } |
701 | }, | 701 | }, |
702 | 702 | ||
703 | |||
703 | BuildSecondCtrlPoint:{ | 704 | BuildSecondCtrlPoint:{ |
704 | value: function(p0, p2, p3) { | 705 | value: function(p0, p2, p3) { |
705 | var baselineOrig = VecUtils.vecSubtract(3, p3, p0); | 706 | var baselineOrig = VecUtils.vecSubtract(3, p3, p0); |
@@ -1051,11 +1052,11 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1051 | } | 1052 | } |
1052 | else{ | 1053 | else{ |
1053 | for (var i=0;i<this.application.ninja.selectedElements.length;i++){ | 1054 | for (var i=0;i<this.application.ninja.selectedElements.length;i++){ |
1054 | var element = this.application.ninja.selectedElements[i]._element; | 1055 | var element = this.application.ninja.selectedElements[i] |
1055 | console.log("Entered pen tool, had selected: " + element.elementModel.selection); | 1056 | console.log("Entered pen tool, had selected: " + element.elementModel.selection); |
1056 | if (element.elementModel.selection === 'Subpath'){ //TODO what to do if the canvas is drawn by tag tool? | 1057 | if (element.elementModel.selection === 'Subpath'){ //TODO what to do if the canvas is drawn by tag tool? |
1057 | //set the pen canvas to be the selected canvas | 1058 | //set the pen canvas to be the selected canvas |
1058 | this._penCanvas = this.application.ninja.selectedElements[i]._element; | 1059 | this._penCanvas = this.application.ninja.selectedElements[i]; |
1059 | 1060 | ||
1060 | // get the subpath for this world | 1061 | // get the subpath for this world |
1061 | this._selectedSubpath = null; | 1062 | this._selectedSubpath = null; |
@@ -1128,7 +1129,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1128 | var els = []; | 1129 | var els = []; |
1129 | ElementController.removeElement(this._penCanvas); | 1130 | ElementController.removeElement(this._penCanvas); |
1130 | els.push(this._penCanvas); | 1131 | els.push(this._penCanvas); |
1131 | NJevent( "deleteSelection", els ); | 1132 | NJevent( "elementsRemoved", els ); |
1132 | this._penCanvas = null; | 1133 | this._penCanvas = null; |
1133 | } | 1134 | } |
1134 | } | 1135 | } |
@@ -1141,9 +1142,9 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1141 | els.push(this.application.ninja.selectedElements[i]); | 1142 | els.push(this.application.ninja.selectedElements[i]); |
1142 | } | 1143 | } |
1143 | for(i=0; i<len; i++) { | 1144 | for(i=0; i<len; i++) { |
1144 | ElementController.removeElement(els[i]._element); | 1145 | ElementController.removeElement(els[i]); |
1145 | } | 1146 | } |
1146 | NJevent( "deleteSelection", els ); | 1147 | NJevent( "elementsRemoved", els ); |
1147 | 1148 | ||
1148 | //clear out the selected path if it exists | 1149 | //clear out the selected path if it exists |
1149 | if (this._selectedSubpath) { | 1150 | if (this._selectedSubpath) { |