diff options
author | Ananya Sen | 2012-02-03 09:57:41 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-03 09:57:41 -0800 |
commit | c093dd13a84ce6eb3e00a672c38a808093c5d966 (patch) | |
tree | 5dfd4a800bbbe02a8cbcb3ffeee542686bc258bb /js/stage/stage.reel/stage.js | |
parent | 79b0173eeca079dec42ff1480182656dbe3af44f (diff) | |
parent | 8e06b63e5eab5558823f4923e20a832c8b36cbe2 (diff) | |
download | ninja-c093dd13a84ce6eb3e00a672c38a808093c5d966.tar.gz |
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
Conflicts:
js/io/document/document-controller.js
js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
js/io/ui/save-as-dialog.reel/save-as-dialog.js
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/stage/stage.reel/stage.js')
-rwxr-xr-x | js/stage/stage.reel/stage.js | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 3e0b852e..9e2df5a2 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -175,7 +175,7 @@ exports.Stage = Montage.create(Component, { | |||
175 | } | 175 | } |
176 | else if(this.updatedStage) { | 176 | else if(this.updatedStage) { |
177 | this.layout.draw(); | 177 | this.layout.draw(); |
178 | this.layout.draw3DInfo(); | 178 | this.layout.draw3DInfo(true); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | }, | 181 | }, |
@@ -787,14 +787,9 @@ exports.Stage = Montage.create(Component, { | |||
787 | var userContent = this.application.ninja.currentDocument.documentRoot; | 787 | var userContent = this.application.ninja.currentDocument.documentRoot; |
788 | if (userContent) | 788 | if (userContent) |
789 | { | 789 | { |
790 | var w = userContent.offsetWidth, | 790 | var w = this._canvas.width, |
791 | h = userContent.offsetHeight; | 791 | h = this._canvas.height; |
792 | if(userContent.width) | 792 | var globalPt = [w/2, h/2, 0]; |
793 | w = userContent.width; | ||
794 | if(userContent.height) | ||
795 | h = userContent.height; | ||
796 | var localPt = [ w/2, h/2, 0]; | ||
797 | var globalPt = this.stageDeps.viewUtils.localToGlobal( localPt, userContent ); | ||
798 | 793 | ||
799 | this.stageDeps.viewUtils.setStageZoom( globalPt, value/100 ); | 794 | this.stageDeps.viewUtils.setStageZoom( globalPt, value/100 ); |
800 | 795 | ||
@@ -811,42 +806,66 @@ exports.Stage = Montage.create(Component, { | |||
811 | } | 806 | } |
812 | }, | 807 | }, |
813 | 808 | ||
809 | getPlaneForView: | ||
810 | { | ||
811 | value: function( side ) | ||
812 | { | ||
813 | var plane = [0,0,1,0]; | ||
814 | switch(side) | ||
815 | { | ||
816 | case "top": | ||
817 | plane = [0,1,0,0]; | ||
818 | plane[3] = this.application.ninja.currentDocument.documentRoot.offsetHeight / 2.0; | ||
819 | break; | ||
820 | |||
821 | case "side": | ||
822 | plane = [1,0,0,0]; | ||
823 | plane[3] = this.application.ninja.currentDocument.documentRoot.offsetWidth / 2.0; | ||
824 | break; | ||
825 | |||
826 | case "front": | ||
827 | plane = [0,0,1,0]; | ||
828 | break; | ||
829 | |||
830 | default: | ||
831 | console.log( "unrecognized view in snapManager.getPlaneForView: " + side ); | ||
832 | break; | ||
833 | } | ||
834 | |||
835 | return plane; | ||
836 | } | ||
837 | }, | ||
838 | |||
814 | setStageView: { | 839 | setStageView: { |
815 | value: function(side) { | 840 | value: function(side) { |
816 | var mat, | 841 | var mat, |
817 | workingPlane = null, | 842 | currentDoc = this.application.ninja.currentDocument.documentRoot, |
818 | currentDoc = this.application.ninja.currentDocument.documentRoot; | 843 | isDrawingGrid = this.application.ninja.appModel.show3dGrid; |
819 | // Stage 3d Props. | 844 | // Stage 3d Props. |
820 | currentDoc.elementModel.props3D.ResetTranslationValues(); | 845 | currentDoc.elementModel.props3D.ResetTranslationValues(); |
821 | currentDoc.elementModel.props3D.ResetRotationValues(); | 846 | currentDoc.elementModel.props3D.ResetRotationValues(); |
822 | 847 | ||
823 | 848 | ||
824 | switch(side) { | 849 | switch(side){ |
825 | case "top": | 850 | case "top": |
826 | mat = Matrix.RotationX(Math.PI * 270.0/180.0); | 851 | mat = Matrix.RotationX(Math.PI * 270.0/180.0); |
827 | |||
828 | drawUtils.drawXY = drawUtils.drawYZ = false; | 852 | drawUtils.drawXY = drawUtils.drawYZ = false; |
829 | drawUtils.drawXZ = drawUtils.isDrawingGrid(); | 853 | drawUtils.drawXZ = isDrawingGrid; |
830 | workingPlane = [0,1,0,0]; | ||
831 | break; | 854 | break; |
832 | 855 | ||
833 | case "side": | 856 | case "side": |
834 | mat = Matrix.RotationY(Math.PI * 270/180); | 857 | mat = Matrix.RotationY(Math.PI * 270/180); |
835 | |||
836 | drawUtils.drawXY = drawUtils.drawXZ = false; | 858 | drawUtils.drawXY = drawUtils.drawXZ = false; |
837 | drawUtils.drawYZ = drawUtils.isDrawingGrid(); | 859 | drawUtils.drawYZ = isDrawingGrid; |
838 | workingPlane = [1,0,0,0]; | ||
839 | break; | 860 | break; |
840 | 861 | ||
841 | case "front": | 862 | case "front": |
842 | mat = Matrix.I(4); | 863 | mat = Matrix.I(4); |
843 | |||
844 | drawUtils.drawYZ = drawUtils.drawXZ = false; | 864 | drawUtils.drawYZ = drawUtils.drawXZ = false; |
845 | drawUtils.drawXY = drawUtils.isDrawingGrid(); | 865 | drawUtils.drawXY = isDrawingGrid; |
846 | workingPlane = [0,0,1,0]; | ||
847 | break; | 866 | break; |
848 | } | 867 | } |
849 | 868 | workingPlane = this.getPlaneForView( side ); | |
850 | 869 | ||
851 | this.stageDeps.viewUtils.setMatrixForElement(currentDoc, mat, false); | 870 | this.stageDeps.viewUtils.setMatrixForElement(currentDoc, mat, false); |
852 | 871 | ||