From 22e664cdbb4bdf54cde87c0c3223e321e18ea372 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 19 Jun 2012 21:34:35 -0700 Subject: IKNINJA-1671 - GIO: 3D rotate widget is offset from the object when rotated in negative space. I fixed this temporarily by disabling the auto stage scroll calculations when we modify matrices. The correct fix will be to update any matrices and local2Global caches if we update the stage's padding (which I'm doing in a separate fix for a single draw cycle for the stage, but that fix is not ready yet). Signed-off-by: Nivesh Rajbhandari --- js/tools/SelectionTool.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 8b644d4a..8c3a9a25 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -47,6 +47,20 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { } }, + _areElementsIn2D : { + value: function () { + if(this.application.ninja.selectedElements.length) { + var len = this.application.ninja.selectedElements.length; + for(var i = 0; i < len; i++) { + if(!MathUtils.isIdentityMatrix(this.application.ninja.selectedElements[i].elementModel.getProperty("mat"))) { + return false; + } + } + } + return true; + } + }, + startDraw: { value: function(event) { this.drawData = null; @@ -70,7 +84,8 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { if(this._canSnap) { this.initializeSnapping(event); - this._use3DMode = !this._areElementsOnSamePlane(); +// this._use3DMode = !this._areElementsOnSamePlane(); + this._use3DMode = !this._areElementsIn2D(); // console.log("use3DMode = " + this._use3DMode); } else -- cgit v1.2.3