From b7f048624c07a1186cca080bf4c9a87af7d53f35 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 1 Jun 2012 06:47:50 -0700 Subject: SnapManager.setupDragPlaneFromPlane must happen after StylesController has finished initializeRootStyles. Signed-off-by: Nivesh Rajbhandari --- js/controllers/styles-controller.js | 6 ++++++ js/stage/stage.reel/stage.js | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 86df82de..14857bf9 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -179,6 +179,10 @@ var stylesController = exports.StylesController = Montage.create(Component, { this.setStyles(rule, styles); this.addClass(this.currentDocument.model.documentRoot, "ninja-body"); } + + //TODO - Temporarily moving this here so we guarantee the StylesController has a chance + // to initialize the stage's styles prior to doing any styles lookup. + this.application.ninja.stage.snapManager.setupDragPlaneFromPlane (workingPlane); } }, /* ----------------- Rule methods ----------------- */ @@ -1204,6 +1208,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { getMatrixFromElement : { value: function(element, isStage) { + isStage = false; var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage), mat; @@ -1237,6 +1242,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { getPerspectiveDistFromElement : { value: function(element, isStage) { + isStage = false; var xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage), dist; diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 087606d0..5a1d7f78 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -1102,7 +1102,9 @@ exports.Stage = Montage.create(Component, { this.snapManager._isCacheInvalid = true; this.snapManager.currentStage = this.application.ninja.currentDocument.model.documentRoot; - this.snapManager.setupDragPlaneFromPlane (workingPlane); + //TODO - StylesController needs to initialize the stage's styles prior to calling this. + // So, moving this into styles-controller.initializeRootStyles code. +// this.snapManager.setupDragPlaneFromPlane (workingPlane); this.drawUtils.initializeFromDocument(); } -- cgit v1.2.3