aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-03 23:08:31 -0700
committerValerio Virgillito2012-05-03 23:08:31 -0700
commit3542dab96689a54f97fff6fc654838c07c724517 (patch)
tree1c8a8a53985bb72a34ad302e402ffe24aec2f242 /js/tools/BrushTool.js
parent24b483db367291b72170f969de78efcb1a9b95bd (diff)
parent60388a7d01d9e34b5cd15bd5cb190a610e4f9a0e (diff)
downloadninja-3542dab96689a54f97fff6fc654838c07c724517.tar.gz
Merge branch 'tag-2.0' of github.com:mencio/ninja-internal into data-id
Conflicts: js/components/tools-properties/tag-properties.reel/tag-properties.html Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/tools/BrushTool.js')
-rw-r--r--js/tools/BrushTool.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index ded56ecc..5c334b92 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -374,13 +374,11 @@ exports.BrushTool = Montage.create(ShapeTool, {
374 return; 374 return;
375 } 375 }
376 376
377 var left = Math.round(midPt[0] - 0.5 * w);
378 var top = Math.round(midPt[1] - 0.5 * h);
379
380 if (!canvas) { 377 if (!canvas) {
381 var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); 378 var newCanvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument);
382 var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas, true); 379 document.application.njUtils.createModelWithShape(newCanvas, "Brushstroke");
383 ElementMediator.addElements(newCanvas, elementModel.data, false); 380 var styles = document.application.njUtils.stylesFromDraw(newCanvas, w, h, {midPt: midPt, planeMat: planeMat});
381 this.application.ninja.elementMediator.addElements(newCanvas, styles, false);
384 382
385 // create all the GL stuff 383 // create all the GL stuff
386 var world = this.getGLWorld(newCanvas, this._useWebGL); 384 var world = this.getGLWorld(newCanvas, this._useWebGL);