diff options
author | Pushkar Joshi | 2012-04-11 15:24:53 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-04-11 15:24:53 -0700 |
commit | 9a518896ed98022f589f06276197c160431bdda0 (patch) | |
tree | e581f529fde2b952dc7e2950bdd2034712007962 /js/tools | |
parent | 8440896d099e09ee306671c6c906eec027383266 (diff) | |
download | ninja-9a518896ed98022f589f06276197c160431bdda0.tar.gz |
create paths in 3D...still buggy if starting from scratch in planes other than XY
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/PenTool.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index ed08372d..22172193 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -108,7 +108,8 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
108 | snapManager.enableSnapAlign(false); | 108 | snapManager.enableSnapAlign(false); |
109 | 109 | ||
110 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); | 110 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); |
111 | var unsnappedpos = DrawingToolBase.getHitRecPos(snapManager.snap(point.x, point.y, false)); | 111 | var unsnappedpos = //snapManager.snap(point.x, point.y, false).calculateStageWorldPoint(); |
112 | DrawingToolBase.getHitRecPos(snapManager.snap(point.x, point.y, false)); | ||
112 | this._dragPlane = snapManager.getDragPlane(); | 113 | this._dragPlane = snapManager.getDragPlane(); |
113 | 114 | ||
114 | snapManager.enableElementSnap(elemSnap); | 115 | snapManager.enableElementSnap(elemSnap); |
@@ -261,9 +262,9 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
261 | if (!this._selectedSubpath.getIsClosed() || this._makeMultipleSubpaths) { | 262 | if (!this._selectedSubpath.getIsClosed() || this._makeMultipleSubpaths) { |
262 | this._selectedSubpath.addAnchor(new AnchorPoint()); | 263 | this._selectedSubpath.addAnchor(new AnchorPoint()); |
263 | var newAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); | 264 | var newAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); |
264 | newAnchor.setPos(mouseDownPos[0], mouseDownPos[1], mouseDownPos[2]); | 265 | newAnchor.setPos(swMousePos[0], swMousePos[1], swMousePos[2]); |
265 | newAnchor.setPrevPos(mouseDownPos[0], mouseDownPos[1], mouseDownPos[2]); | 266 | newAnchor.setPrevPos(swMousePos[0], swMousePos[1], swMousePos[2]); |
266 | newAnchor.setNextPos(mouseDownPos[0], mouseDownPos[1], mouseDownPos[2]); | 267 | newAnchor.setNextPos(swMousePos[0], swMousePos[1], swMousePos[2]); |
267 | 268 | ||
268 | //set the mode so that dragging will update the next and previous locations | 269 | //set the mode so that dragging will update the next and previous locations |
269 | this._editMode = this.EDIT_PREV_NEXT; | 270 | this._editMode = this.EDIT_PREV_NEXT; |
@@ -274,9 +275,6 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
274 | if (!this._selectedSubpath.getIsClosed()) { | 275 | if (!this._selectedSubpath.getIsClosed()) { |
275 | this._selectedSubpath.addAnchor(new AnchorPoint()); | 276 | this._selectedSubpath.addAnchor(new AnchorPoint()); |
276 | var newAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); | 277 | var newAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); |
277 | /*newAnchor.setPos(mouseDownPos[0], mouseDownPos[1], mouseDownPos[2]); | ||
278 | newAnchor.setPrevPos(mouseDownPos[0], mouseDownPos[1], mouseDownPos[2]); | ||
279 | newAnchor.setNextPos(mouseDownPos[0], mouseDownPos[1], mouseDownPos[2]);*/ | ||
280 | newAnchor.setPos(swMousePos[0], swMousePos[1], swMousePos[2]); | 278 | newAnchor.setPos(swMousePos[0], swMousePos[1], swMousePos[2]); |
281 | newAnchor.setPrevPos(swMousePos[0], swMousePos[1], swMousePos[2]); | 279 | newAnchor.setPrevPos(swMousePos[0], swMousePos[1], swMousePos[2]); |
282 | newAnchor.setNextPos(swMousePos[0], swMousePos[1], swMousePos[2]); | 280 | newAnchor.setNextPos(swMousePos[0], swMousePos[1], swMousePos[2]); |