diff options
-rwxr-xr-x | js/tools/Rotate3DToolBase.js | 15 | ||||
-rwxr-xr-x | js/tools/Translate3DToolBase.js | 9 |
2 files changed, 12 insertions, 12 deletions
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, { | |||
438 | value : function() | 438 | value : function() |
439 | { | 439 | { |
440 | var item, | 440 | var item, |
441 | elt, | ||
442 | mat, | 441 | mat, |
443 | dist, | 442 | dist, |
444 | newStyles = [], | 443 | newStyles = [], |
445 | previousStyles = [], | 444 | previousStyles = [], |
446 | len = this._targets.length, | 445 | len = this.application.ninja.selectedElements.length, |
447 | iMat; | 446 | iMat; |
448 | for(var i = 0; i < len; i++) | 447 | for(var i = 0; i < len; i++) |
449 | { | 448 | { |
450 | // Reset to the identity matrix | 449 | // Reset to the identity matrix |
451 | item = this._targets[i]; | 450 | item = this.application.ninja.selectedElements[i]; |
452 | iMat = Matrix.I(4); | 451 | iMat = Matrix.I(4); |
453 | mat = item.mat; | 452 | mat = ElementsMediator.getMatrix(item); |
454 | // iMat[12] = mat[12]; | 453 | // iMat[12] = mat[12]; |
455 | // iMat[13] = mat[13]; | 454 | // iMat[13] = mat[13]; |
456 | // iMat[14] = mat[14]; | 455 | // iMat[14] = mat[14]; |
457 | 456 | ||
458 | dist = this._undoArray[i].dist; | 457 | dist = ElementsMediator.getPerspectiveDist(item); |
459 | 458 | ||
460 | var previousStyleStr = {dist:dist, mat:mat}; | 459 | var previousStyleStr = {dist:dist, mat:mat}; |
461 | 460 | ||
@@ -476,8 +475,10 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, { | |||
476 | this.isDrawing = false; | 475 | this.isDrawing = false; |
477 | this.endDraw(event); | 476 | this.endDraw(event); |
478 | 477 | ||
479 | // this.UpdateSelection(true); | 478 | // Need to force stage to draw immediately so the new selection center is calculated |
480 | this.Configure(true); | 479 | this.application.ninja.stage.draw(); |
480 | // And captureSelectionDrawn to draw the transform handles | ||
481 | this.captureSelectionDrawn(null); | ||
481 | } | 482 | } |
482 | }, | 483 | }, |
483 | 484 | ||
diff --git a/js/tools/Translate3DToolBase.js b/js/tools/Translate3DToolBase.js index 948383a3..e4f1fb99 100755 --- a/js/tools/Translate3DToolBase.js +++ b/js/tools/Translate3DToolBase.js | |||
@@ -90,22 +90,21 @@ exports.Translate3DToolBase = Montage.create(ModifierToolBase, | |||
90 | value : function() | 90 | value : function() |
91 | { | 91 | { |
92 | var item, | 92 | var item, |
93 | elt, | ||
94 | mat, | 93 | mat, |
95 | dist, | 94 | dist, |
96 | newStyles = [], | 95 | newStyles = [], |
97 | previousStyles = [], | 96 | previousStyles = [], |
98 | len = this._targets.length; | 97 | len = this.application.ninja.selectedElements.length; |
99 | for(var i = 0; i < len; i++) | 98 | for(var i = 0; i < len; i++) |
100 | { | 99 | { |
101 | // Reset to the identity matrix but retain the rotation values | 100 | // Reset to the identity matrix but retain the rotation values |
102 | item = this._targets[i]; | 101 | item = this.application.ninja.selectedElements[i]; |
103 | mat = item.mat.slice(0); | 102 | mat = ElementsMediator.getMatrix(item); |
104 | mat[12] = 0; | 103 | mat[12] = 0; |
105 | mat[13] = 0; | 104 | mat[13] = 0; |
106 | mat[14] = 0; | 105 | mat[14] = 0; |
107 | 106 | ||
108 | dist = this._undoArray[i].dist; | 107 | dist = ElementsMediator.getPerspectiveDist(item); |
109 | 108 | ||
110 | var previousStyleStr = {dist:dist, mat:item.mat}; | 109 | var previousStyleStr = {dist:dist, mat:item.mat}; |
111 | 110 | ||