From 2078bfa96afaef40acb4edac99848ba55e808ef1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 3 May 2012 15:15:21 -0700 Subject: Refactor creating elements. Removed makeNJElement and separated the model creation Signed-off-by: Valerio Virgillito --- js/tools/drawing-tool-base.js | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'js/tools/drawing-tool-base.js') diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index 7d97f105..376b3a27 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js @@ -445,30 +445,6 @@ exports.DrawingToolBase = Montage.create(Montage, { } }, - /** - * Get the matrix for the actual element being added to the user document. - */ - getElementMatrix: { - value: function(planeMat, midPt) { - var divMat, flatMat, flatMatSafe; - // calculate the matrix for the element. - // we should not need to worry about divide by zero below since we snapped to the point - divMat = planeMat.slice(0); - divMat[12] = 0.0; - divMat[13] = 0.0; - //divMat[14] = 0.0; - divMat[14] = midPt[2]; - - // set the left and top of the element such that the center of the rectangle is at the mid point - viewUtils.setViewportObj(this.stage); - - flatMat = divMat; - flatMatSafe = MathUtils.scientificToDecimal(flatMat, 10); - - return "matrix3d(" + flatMatSafe + ")"; - } - }, - /** * Draw Helper Functions */ -- cgit v1.2.3 From 15c7bdad38a83d192bd5a1d55a54362c12c73d38 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 8 May 2012 12:10:07 -0700 Subject: Fixed a snapping issue on the mouse down in drawing tools. --- js/tools/drawing-tool-base.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'js/tools/drawing-tool-base.js') diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index 376b3a27..84641754 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js @@ -36,9 +36,8 @@ exports.DrawingToolBase = Montage.create(Montage, { * 2 - Y value converted to screen point */ getInitialSnapPoint: { - value: function(x, y, shapeCanvas) { - snapManager.clearDragPlane(); - + value: function(x, y, shapeCanvas) + { // update the snap settings snapManager.enableSnapAlign( snapManager.snapAlignEnabledAppLevel() ); snapManager.enableElementSnap( snapManager.elementSnapEnabledAppLevel() ); -- cgit v1.2.3