aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-05-07 16:30:19 -0700
committerJohn Mayhew2012-05-07 16:30:19 -0700
commitdb4ba95f50148198759dde503ec1c778184d9dbe (patch)
tree8b79ad58108af2f17d15abc8cdc33d35229ab20d /js/tools/BrushTool.js
parent843d8ea8ee58a54bcb71d7b28dbf78fae153b491 (diff)
parent526e423e4a2734c2b139af23911e912452a4443f (diff)
downloadninja-db4ba95f50148198759dde503ec1c778184d9dbe.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/components/layout/tools-list.reel/tools-list.html js/components/layout/tools-properties.reel/tools-properties.html js/components/tools-properties/brush-properties.reel/brush-properties.html js/components/tools-properties/fill-properties.reel/fill-properties.html js/components/tools-properties/pen-properties.reel/pen-properties.html js/components/tools-properties/pencil-properties.reel/pencil-properties.html js/components/tools-properties/selection-properties.reel/selection-properties.html js/components/tools-properties/shape-properties.reel/shape-properties.html js/components/tools-properties/tag-properties.reel/tag-properties.html js/components/tools-properties/text-properties.reel/text-properties.html
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 7e5e0630..0be378fd 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);