aboutsummaryrefslogtreecommitdiff
path: root/js/tools/PenTool.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-04 14:41:16 -0700
committerJohn Mayhew2012-04-04 14:41:16 -0700
commit7249d6377c8897b2f9d8115be99717be971a0981 (patch)
tree9415f5ba25ad643df678e561719d2708fd3ead5a /js/tools/PenTool.js
parentebdfa77a5399d245ddf134ee8110b2d046922a71 (diff)
parent8482e23cd9b8c4700b5130f2588e5eb24d376536 (diff)
downloadninja-7249d6377c8897b2f9d8115be99717be971a0981.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/lib/drawing/world.js
Diffstat (limited to 'js/tools/PenTool.js')
-rwxr-xr-xjs/tools/PenTool.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 779b7f16..4a16a491 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -585,7 +585,7 @@ exports.PenTool = Montage.create(ShapeTool, {
585 var newCanvas = null; 585 var newCanvas = null;
586 newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); 586 newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
587 var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas); 587 var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas);
588 ElementMediator.addElement(newCanvas, elementModel.data, true); 588 ElementMediator.addElements(newCanvas, elementModel.data, false);
589 589
590 // create all the GL stuff 590 // create all the GL stuff
591 var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial); 591 var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial);
@@ -978,11 +978,11 @@ exports.PenTool = Montage.create(ShapeTool, {
978 } 978 }
979 else{ 979 else{
980 for (var i=0;i<this.application.ninja.selectedElements.length;i++){ 980 for (var i=0;i<this.application.ninja.selectedElements.length;i++){
981 var element = this.application.ninja.selectedElements[i]._element; 981 var element = this.application.ninja.selectedElements[i]
982 console.log("Entered pen tool, had selected: " + element.elementModel.selection); 982 console.log("Entered pen tool, had selected: " + element.elementModel.selection);
983 if (element.elementModel.selection === 'Subpath'){ //TODO what to do if the canvas is drawn by tag tool? 983 if (element.elementModel.selection === 'Subpath'){ //TODO what to do if the canvas is drawn by tag tool?
984 //set the pen canvas to be the selected canvas 984 //set the pen canvas to be the selected canvas
985 this._penCanvas = this.application.ninja.selectedElements[i]._element; 985 this._penCanvas = this.application.ninja.selectedElements[i];
986 986
987 // get the subpath for this world 987 // get the subpath for this world
988 this._selectedSubpath = null; 988 this._selectedSubpath = null;
@@ -1057,7 +1057,7 @@ exports.PenTool = Montage.create(ShapeTool, {
1057 var els = []; 1057 var els = [];
1058 ElementController.removeElement(this._penCanvas); 1058 ElementController.removeElement(this._penCanvas);
1059 els.push(this._penCanvas); 1059 els.push(this._penCanvas);
1060 NJevent( "deleteSelection", els ); 1060 NJevent( "elementsRemoved", els );
1061 this._penCanvas = null; 1061 this._penCanvas = null;
1062 } 1062 }
1063 } 1063 }
@@ -1073,9 +1073,9 @@ exports.PenTool = Montage.create(ShapeTool, {
1073 els.push(this.application.ninja.selectedElements[i]); 1073 els.push(this.application.ninja.selectedElements[i]);
1074 } 1074 }
1075 for(i=0; i<len; i++) { 1075 for(i=0; i<len; i++) {
1076 ElementController.removeElement(els[i]._element); 1076 ElementController.removeElement(els[i]);
1077 } 1077 }
1078 NJevent( "deleteSelection", els ); 1078 NJevent( "elementsRemoved", els );
1079 1079
1080 //clear out the selected path if it exists 1080 //clear out the selected path if it exists
1081 if (this._selectedSubpath) { 1081 if (this._selectedSubpath) {