diff options
author | hwc487 | 2012-04-27 13:52:40 -0700 |
---|---|---|
committer | hwc487 | 2012-04-27 13:52:40 -0700 |
commit | e73fba18b095f0c270f5d954e5993c155b488c73 (patch) | |
tree | da18c6c0117fec3652b823bddc198add47632fc8 /js/tools/ShapeTool.js | |
parent | 4b83774cdbfbf30add9a8fa2f11b1c4ff35179fa (diff) | |
download | ninja-e73fba18b095f0c270f5d954e5993c155b488c73.tar.gz |
Creating shapes in a container
Diffstat (limited to 'js/tools/ShapeTool.js')
-rwxr-xr-x | js/tools/ShapeTool.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index 74e692b6..90b403a4 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js | |||
@@ -64,6 +64,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
64 | if(drawData) { | 64 | if(drawData) { |
65 | var canvas; | 65 | var canvas; |
66 | if(!this._useExistingCanvas()) { | 66 | if(!this._useExistingCanvas()) { |
67 | console.log( "creating a new canvas" ); | ||
67 | canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); | 68 | canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); |
68 | var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height, | 69 | var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height, |
69 | drawData.planeMat, drawData.midPt, canvas, true); | 70 | drawData.planeMat, drawData.midPt, canvas, true); |
@@ -71,6 +72,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
71 | canvas.elementModel.isShape = true; | 72 | canvas.elementModel.isShape = true; |
72 | this.application.ninja.elementMediator.addElements(canvas, elementModel.data); | 73 | this.application.ninja.elementMediator.addElements(canvas, elementModel.data); |
73 | } else { | 74 | } else { |
75 | console.log( "inserting shape into container" ); | ||
74 | canvas = this._targetedElement; | 76 | canvas = this._targetedElement; |
75 | if (!canvas.getAttribute( "data-RDGE-id" )) | 77 | if (!canvas.getAttribute( "data-RDGE-id" )) |
76 | canvas.setAttribute( "data-RDGE-id", NJUtils.generateRandom() ); | 78 | canvas.setAttribute( "data-RDGE-id", NJUtils.generateRandom() ); |