diff options
author | Pushkar Joshi | 2012-04-19 11:58:20 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-04-19 11:58:20 -0700 |
commit | bc1bc57a7c8a32bf92bca8aa758b0ea0eeaffbc3 (patch) | |
tree | e8917a6e35bb9883bd192b6d5b97214aafc10a77 /js/tools | |
parent | d703eeb01afa818a02538ec4efa66ac7350bac06 (diff) | |
download | ninja-bc1bc57a7c8a32bf92bca8aa758b0ea0eeaffbc3.tar.gz |
correctly maintain canvas position when drawing subpaths off the XY plane (was a bug with starting drawing in those planes)
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/PenTool.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 8ac48d55..ffad2789 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -572,6 +572,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
572 | var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial); | 572 | var world = this.getGLWorld(newCanvas, this._useWebGL);//this.options.use3D);//this.CreateGLWorld(planeMat, midPt, newCanvas, this._useWebGL);//fillMaterial, strokeMaterial); |
573 | //store a reference to this newly created canvas | 573 | //store a reference to this newly created canvas |
574 | this._selectedSubpathCanvas = newCanvas; | 574 | this._selectedSubpathCanvas = newCanvas; |
575 | this._selectedSubpathPlaneMat = ElementMediator.getMatrix(newCanvas); | ||
575 | 576 | ||
576 | var subpath = this._selectedSubpath; //new GLSubpath(); | 577 | var subpath = this._selectedSubpath; //new GLSubpath(); |
577 | subpath.setWorld(world); | 578 | subpath.setWorld(world); |
@@ -820,6 +821,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
820 | }, | 821 | }, |
821 | 822 | ||
822 | //perform the inverse of the perspective scaling performed by the browser | 823 | //perform the inverse of the perspective scaling performed by the browser |
824 | // (currently unused function) | ||
823 | _unprojectPt: { | 825 | _unprojectPt: { |
824 | value: function(pt, pespectiveDist) { | 826 | value: function(pt, pespectiveDist) { |
825 | var retPt = pt.slice(0); | 827 | var retPt = pt.slice(0); |
@@ -1254,6 +1256,8 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1254 | if (wasSelected) { | 1256 | if (wasSelected) { |
1255 | defaultEventManager.addEventListener("resetPenTool", this, false); | 1257 | defaultEventManager.addEventListener("resetPenTool", this, false); |
1256 | this.application.ninja.elementMediator.deleteDelegate = this; | 1258 | this.application.ninja.elementMediator.deleteDelegate = this; |
1259 | this.application.ninja.stage.drawingCanvas.style.cursor = //"auto"; | ||
1260 | "url('images/cursors/penCursors/Pen_newPath.png') 5 1, default"; | ||
1257 | 1261 | ||
1258 | if (this.application.ninja.selectedElements.length === 0){ | 1262 | if (this.application.ninja.selectedElements.length === 0){ |
1259 | this._entryEditMode = this.ENTRY_SELECT_NONE; | 1263 | this._entryEditMode = this.ENTRY_SELECT_NONE; |
@@ -1328,6 +1332,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1328 | this._selectedSubpath.createSamples(false); | 1332 | this._selectedSubpath.createSamples(false); |
1329 | //clear the canvas | 1333 | //clear the canvas |
1330 | this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas(); | 1334 | this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas(); |
1335 | this.PrepareSelectedSubpathForRendering(); | ||
1331 | this.DrawSubpathAnchors(this._selectedSubpath); | 1336 | this.DrawSubpathAnchors(this._selectedSubpath); |
1332 | this.ShowSelectedSubpath(); | 1337 | this.ShowSelectedSubpath(); |
1333 | } | 1338 | } |