From 9eeb03e8bb86a4462609d3a18b528daa1516b91c Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 7 May 2012 13:57:18 -0700 Subject: fixes for 2D and 3D translation. --- js/tools/SelectionTool.js | 2 +- js/tools/TranslateObject3DTool.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 855c7b8c..07c26b8c 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -504,7 +504,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { delta = vecUtils.vecSubtract( 3, data.pt1, data.pt0 ); delta[0] = ~~delta[0]; delta[1] = ~~delta[1]; - delta[2] = 0; + //delta[2] = 0; var transMat = Matrix.Translation( delta ); this._moveElements(transMat); } diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js index b4f55bd9..f8b32d23 100755 --- a/js/tools/TranslateObject3DTool.js +++ b/js/tools/TranslateObject3DTool.js @@ -54,10 +54,10 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { else { this._delta = null; - // special case for z-translation - if(this._handleMode === 2) + //if(this._handleMode === 2) { - this._dragPlane = viewUtils.getNormalToUnprojectedElementPlane(this._target); + this._dragPlane = viewUtils.getNormalToUnprojectedElementPlane(this._target, this._handleMode, this._inLocalMode); + //console.log( "dragPlane: " + this._dragPlane ); snapManager.setupDragPlaneFromPlane(this._dragPlane); do3DSnap = false; @@ -86,7 +86,8 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { var elt = this.application.ninja.stage.getElement(event, true); if(elt && (elt !== hitRec.getElement())) { - hitRec = snapManager.findHitRecordForElement(elt); + var otherSnap = snapManager.findHitRecordForElement(elt); + if (otherSnap) hitRec = otherSnap; } if(elt === this.application.ninja.currentSelectedContainer) { -- 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') 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