From 1e2e0a8d04e55c0ecfb0b1b674792b69fb091415 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 5 Apr 2012 12:01:38 -0700 Subject: Fixing 3d tool reset to redraw handles. Signed-off-by: Nivesh Rajbhandari --- js/tools/Rotate3DToolBase.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'js/tools/Rotate3DToolBase.js') diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js index eb2cdba4..696408bf 100755 --- a/js/tools/Rotate3DToolBase.js +++ b/js/tools/Rotate3DToolBase.js @@ -438,24 +438,23 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, { value : function() { var item, - elt, mat, dist, newStyles = [], previousStyles = [], - len = this._targets.length, + len = this.application.ninja.selectedElements.length, iMat; for(var i = 0; i < len; i++) { // Reset to the identity matrix - item = this._targets[i]; + item = this.application.ninja.selectedElements[i]; iMat = Matrix.I(4); - mat = item.mat; + mat = ElementsMediator.getMatrix(item); // iMat[12] = mat[12]; // iMat[13] = mat[13]; // iMat[14] = mat[14]; - dist = this._undoArray[i].dist; + dist = ElementsMediator.getPerspectiveDist(item); var previousStyleStr = {dist:dist, mat:mat}; @@ -476,8 +475,10 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, { this.isDrawing = false; this.endDraw(event); -// this.UpdateSelection(true); - this.Configure(true); + // Need to force stage to draw immediately so the new selection center is calculated + this.application.ninja.stage.draw(); + // And captureSelectionDrawn to draw the transform handles + this.captureSelectionDrawn(null); } }, -- cgit v1.2.3