diff options
author | Nivesh Rajbhandari | 2012-05-01 20:13:58 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-05-01 20:13:58 -0700 |
commit | 355656cac2fa1a025ad97791ea095a54cebdff71 (patch) | |
tree | feb28083c4540ea6298a8d6d3410ffa0e9c15527 /js/tools/drawing-tool.js | |
parent | 0f16c5ea0d08a740f553284c436bb3e589fb1357 (diff) | |
download | ninja-355656cac2fa1a025ad97791ea095a54cebdff71.tar.gz |
Support drawing in side and top view. Also, adding back support for drawing shapes inside canvas when double-clicked into canvas or when moused over canvas.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/tools/drawing-tool.js')
-rwxr-xr-x | js/tools/drawing-tool.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/tools/drawing-tool.js b/js/tools/drawing-tool.js index dc5f7996..d906fdf9 100755 --- a/js/tools/drawing-tool.js +++ b/js/tools/drawing-tool.js | |||
@@ -72,10 +72,11 @@ exports.DrawingTool = Montage.create(ToolBase, { | |||
72 | var snapData, point; | 72 | var snapData, point; |
73 | 73 | ||
74 | this._isDrawing = true; | 74 | this._isDrawing = true; |
75 | this.mouseDownHitRec = null; | ||
75 | this.mouseUpHitRec = null; | 76 | this.mouseUpHitRec = null; |
76 | 77 | ||
77 | point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); | 78 | point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); |
78 | snapData = DrawingToolBase.getInitialSnapPoint(point.x, point.y); //event.layerX, event.layerY); | 79 | snapData = DrawingToolBase.getInitialSnapPoint(point.x, point.y, this._targetedElement); //event.layerX, event.layerY); |
79 | this.mouseDownHitRec = snapData[0]; | 80 | this.mouseDownHitRec = snapData[0]; |
80 | this.downPoint.x = snapData[1]; | 81 | this.downPoint.x = snapData[1]; |
81 | this.downPoint.y = snapData[2]; | 82 | this.downPoint.y = snapData[2]; |