aboutsummaryrefslogtreecommitdiff
path: root/js/tools/PenTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/PenTool.js')
-rwxr-xr-xjs/tools/PenTool.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index fb7f6d6d..fd470af7 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -578,17 +578,16 @@ exports.PenTool = Montage.create(ShapeTool, {
578 return; 578 return;
579 } 579 }
580 580
581 w= Math.round(w); 581 w = Math.round(w);
582 h = Math.round(h); 582 h = Math.round(h);
583 var left = Math.round(midPt[0] - 0.5 * w); 583 var left = Math.round(midPt[0] - 0.5 * w);
584 var top = Math.round(midPt[1] - 0.5 * h); 584 var top = Math.round(midPt[1] - 0.5 * h);
585 585
586 if (!canvas) { 586 if (!canvas) {
587 var newCanvas = null; 587 var newCanvas = document.application.njUtils.make("canvas", {"data-RDGE-id": NJUtils.generateRandom()}, this.application.ninja.currentDocument);
588 newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); 588 document.application.njUtils.createModelWithShape(newCanvas, "Subpath");
589 var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas, true); 589 var styles = document.application.njUtils.stylesFromDraw(newCanvas, parseInt(w), parseInt(h), {midPt: midPt, planeMat: planeMat});
590 //note that we set the notify event to false because we send the event separately at end of this code block 590 this.application.ninja.elementMediator.addElements(newCanvas, styles, false);
591 ElementMediator.addElements(newCanvas, elementModel.data, false);
592 591
593 // create all the GL stuff 592 // create all the GL stuff
594 var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial); 593 var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial);