aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
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 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);