aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerio Virgillito2012-03-14 23:25:34 -0700
committerValerio Virgillito2012-03-14 23:25:34 -0700
commitda5dfc8863ad47c48414ff1fdacbacdb91abd30c (patch)
tree22961320d21c29161650fa0199c55ddda1bd0554
parenta7cb2c0b22f03b79f19d4a9a2eb691d1ccc392f9 (diff)
downloadninja-da5dfc8863ad47c48414ff1fdacbacdb91abd30c.tar.gz
Fixing the splitter resize canvas bug by getting the size when a document is opened.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
-rwxr-xr-xjs/panels/Splitter.js6
-rwxr-xr-xjs/stage/stage.reel/stage.js7
2 files changed, 5 insertions, 8 deletions
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js
index a396ea28..e92cb2dd 100755
--- a/js/panels/Splitter.js
+++ b/js/panels/Splitter.js
@@ -91,12 +91,6 @@ exports.Splitter = Montage.create(Component, {
91 } 91 }
92 }, 92 },
93 93
94 didDraw: {
95 value: function() {
96 this.application.ninja.stage.resizeCanvases = true;
97 }
98 },
99
100 handleClick : { 94 handleClick : {
101 value: function() { 95 value: function() {
102 if (!this.disabled) { 96 if (!this.disabled) {
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index a624b2c6..e139af97 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -170,8 +170,7 @@ exports.Stage = Montage.create(Component, {
170 170
171 // Hack for now until a full component 171 // Hack for now until a full component
172 this.layout.draw(); 172 this.layout.draw();
173 } 173 } else if(this.updatedStage) {
174 else if(this.updatedStage) {
175 this.layout.draw(); 174 this.layout.draw();
176 this.layout.draw3DInfo(true); 175 this.layout.draw3DInfo(true);
177 } 176 }
@@ -235,6 +234,10 @@ exports.Stage = Montage.create(Component, {
235 234
236 this.hideCanvas(false); 235 this.hideCanvas(false);
237 236
237 // Recalculate the canvas sizes because of splitter resizing
238 this._canvas.width = this._layoutCanvas.width = this._drawingCanvas.width = this.element.offsetWidth - 11 ;
239 this._canvas.height = this._layoutCanvas.height = this._drawingCanvas.height = this.element.offsetHeight - 11;
240
238 this._documentRoot = this.application.ninja.currentDocument.documentRoot; 241 this._documentRoot = this.application.ninja.currentDocument.documentRoot;
239 this._viewport = this.application.ninja.currentDocument.documentRoot.parentNode; 242 this._viewport = this.application.ninja.currentDocument.documentRoot.parentNode;
240 243