diff options
author | Nivesh Rajbhandari | 2012-04-16 16:06:24 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-16 16:06:24 -0700 |
commit | c253192a08b499ea7be46fa5438d273e51f7ec5a (patch) | |
tree | 18a1f0e3679c0eb993a9dedb537035d3861f49ac /js/tools/Rotate3DToolBase.js | |
parent | e19376c54eedd1f1c457ba405b2f110be376a559 (diff) | |
parent | 4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff) | |
download | ninja-c253192a08b499ea7be46fa5438d273e51f7ec5a.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/tools/Rotate3DToolBase.js')
-rwxr-xr-x | js/tools/Rotate3DToolBase.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js index b04e8b0a..696408bf 100755 --- a/js/tools/Rotate3DToolBase.js +++ b/js/tools/Rotate3DToolBase.js | |||
@@ -262,7 +262,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, { | |||
262 | { | 262 | { |
263 | if(len === 1) | 263 | if(len === 1) |
264 | { | 264 | { |
265 | this.target = this.application.ninja.selectedElements[0]._element; | 265 | this.target = this.application.ninja.selectedElements[0]; |
266 | drawUtils.addElement(this.target); | 266 | drawUtils.addElement(this.target); |
267 | 267 | ||
268 | viewUtils.pushViewportObj( this.target ); | 268 | viewUtils.pushViewportObj( this.target ); |
@@ -311,7 +311,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, { | |||
311 | this._targets = []; | 311 | this._targets = []; |
312 | for(var i = 0; i < len; i++) | 312 | for(var i = 0; i < len; i++) |
313 | { | 313 | { |
314 | var elt = this.application.ninja.selectedElements[i]._element; | 314 | var elt = this.application.ninja.selectedElements[i]; |
315 | // this._initProps3D(elt); | 315 | // this._initProps3D(elt); |
316 | 316 | ||
317 | 317 | ||
@@ -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 | ||