diff options
author | Pushkar Joshi | 2012-05-07 11:00:22 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-05-07 11:00:22 -0700 |
commit | e5ae6e0b6e54db0e6efd75d1f14cb791060ed67a (patch) | |
tree | e84d2dc5033c1b5c1b993662660a90af12584b69 /js/tools/BrushTool.js | |
parent | ba890518b5a35d5e6893f9fc72d2eee30ae07e17 (diff) | |
parent | 526e423e4a2734c2b139af23911e912452a4443f (diff) | |
download | ninja-e5ae6e0b6e54db0e6efd75d1f14cb791060ed67a.tar.gz |
Merge branch 'master' into pentool
Diffstat (limited to 'js/tools/BrushTool.js')
-rw-r--r-- | js/tools/BrushTool.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 1666d311..5d4e8288 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js | |||
@@ -376,13 +376,11 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
376 | return; | 376 | return; |
377 | } | 377 | } |
378 | 378 | ||
379 | var left = Math.round(midPt[0] - 0.5 * w); | ||
380 | var top = Math.round(midPt[1] - 0.5 * h); | ||
381 | |||
382 | if (!canvas) { | 379 | if (!canvas) { |
383 | var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); | 380 | var newCanvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument); |
384 | var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas, true); | 381 | document.application.njUtils.createModelWithShape(newCanvas, "Brushstroke"); |
385 | ElementMediator.addElements(newCanvas, elementModel.data, false); | 382 | var styles = document.application.njUtils.stylesFromDraw(newCanvas, w, h, {midPt: midPt, planeMat: planeMat}); |
383 | this.application.ninja.elementMediator.addElements(newCanvas, styles, false); | ||
386 | 384 | ||
387 | // create all the GL stuff | 385 | // create all the GL stuff |
388 | var world = this.getGLWorld(newCanvas, this._useWebGL); | 386 | var world = this.getGLWorld(newCanvas, this._useWebGL); |