diff options
author | Nivesh Rajbhandari | 2012-05-07 11:18:11 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-05-07 11:18:11 -0700 |
commit | e377a8dc0b0e34905782ed867acb5fe725ae0131 (patch) | |
tree | 6931311aabd7a4e366df195a168d437f1d0d8465 /js/tools/LineTool.js | |
parent | 8be6e94b57f4bd6e28754a6113b4d6a401365e13 (diff) | |
parent | 526e423e4a2734c2b139af23911e912452a4443f (diff) | |
download | ninja-e377a8dc0b0e34905782ed867acb5fe725ae0131.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/tools/LineTool.js')
-rwxr-xr-x | js/tools/LineTool.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index a32fbdc8..198d7e69 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -77,10 +77,11 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
77 | h += ~~(yAdj*2); | 77 | h += ~~(yAdj*2); |
78 | } | 78 | } |
79 | 79 | ||
80 | canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); | 80 | canvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument); |
81 | var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas, true); | 81 | document.application.njUtils.createModelWithShape(canvas, "Line"); |
82 | canvas.elementModel.isShape = true; | 82 | |
83 | this.application.ninja.elementMediator.addElements(canvas, elementModel.data); | 83 | var styles = document.application.njUtils.stylesFromDraw(canvas, w, h, drawData); |
84 | this.application.ninja.elementMediator.addElements(canvas, styles); | ||
84 | } else { | 85 | } else { |
85 | canvas = this._targetedElement; | 86 | canvas = this._targetedElement; |
86 | canvas.elementModel.controller = ShapesController; | 87 | canvas.elementModel.controller = ShapesController; |
@@ -242,7 +243,7 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
242 | canvas.elementModel.shapeModel.shapeCount++; | 243 | canvas.elementModel.shapeModel.shapeCount++; |
243 | if(canvas.elementModel.shapeModel.shapeCount === 1) | 244 | if(canvas.elementModel.shapeModel.shapeCount === 1) |
244 | { | 245 | { |
245 | canvas.elementModel.selection = "Line"; | 246 | // canvas.elementModel.selection = "Line"; |
246 | canvas.elementModel.pi = "LinePi"; | 247 | canvas.elementModel.pi = "LinePi"; |
247 | canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; | 248 | canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; |
248 | 249 | ||