diff options
author | Valerio Virgillito | 2012-05-10 13:15:36 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-10 13:15:36 -0700 |
commit | 254e2f8ee3e915c7dafe445c724b88434fb52f28 (patch) | |
tree | 1248de2aa359b76f380eb4d1fadd999b89fa8fca | |
parent | 25e50eed8afbf86606ec5614194dc34f154feecb (diff) | |
parent | 2088ff54c96af4bd5c96075b74939b50c56f5f24 (diff) | |
download | ninja-254e2f8ee3e915c7dafe445c724b88434fb52f28.tar.gz |
Merge pull request #209 from mqg734/Dom-Architecture
Fixed 3d body styles bug.
-rwxr-xr-x | js/controllers/elements/body-controller.js | 6 | ||||
-rwxr-xr-x | js/controllers/styles-controller.js | 2 | ||||
-rwxr-xr-x | js/helper-classes/3D/draw-utils.js | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 943594f2..5c23dcf7 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js | |||
@@ -13,7 +13,7 @@ exports.BodyController = Montage.create(ElementController, { | |||
13 | set3DProperties: { | 13 | set3DProperties: { |
14 | value: function(el, props, update3DModel) { | 14 | value: function(el, props, update3DModel) { |
15 | var dist = props["dist"], mat = props["mat"]; | 15 | var dist = props["dist"], mat = props["mat"]; |
16 | this.application.ninja.stylesController.setElementStyle(el, "-webkit-transform", "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")", true); | 16 | this.application.ninja.stylesController.setElementStyle(el, "-webkit-transform", "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")"); |
17 | 17 | ||
18 | el.elementModel.props3D.matrix3d = mat; | 18 | el.elementModel.props3D.matrix3d = mat; |
19 | el.elementModel.props3D.perspectiveDist = dist; | 19 | el.elementModel.props3D.perspectiveDist = dist; |
@@ -49,13 +49,13 @@ exports.BodyController = Montage.create(ElementController, { | |||
49 | switch(p) { | 49 | switch(p) { |
50 | case "body-background": | 50 | case "body-background": |
51 | case "background": | 51 | case "background": |
52 | this.application.ninja.stylesController.setElementStyle(el, "background-color", value, true); | 52 | this.application.ninja.stylesController.setElementStyle(el, "background-color", value); |
53 | break; | 53 | break; |
54 | case "overflow": | 54 | case "overflow": |
55 | case "width": | 55 | case "width": |
56 | case "height": | 56 | case "height": |
57 | case "-webkit-transform-style": | 57 | case "-webkit-transform-style": |
58 | this.application.ninja.stylesController.setElementStyle(el, p, value, true); | 58 | this.application.ninja.stylesController.setElementStyle(el, p, value); |
59 | this.application.ninja.stage.updatedStage = true; | 59 | this.application.ninja.stage.updatedStage = true; |
60 | break; | 60 | break; |
61 | default: | 61 | default: |
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 647c0870..7707a826 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -1130,6 +1130,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1130 | 1130 | ||
1131 | getMatrixFromElement : { | 1131 | getMatrixFromElement : { |
1132 | value: function(element, isStage) { | 1132 | value: function(element, isStage) { |
1133 | isStage = false; | ||
1133 | var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage), | 1134 | var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage), |
1134 | mat; | 1135 | mat; |
1135 | 1136 | ||
@@ -1163,6 +1164,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1163 | 1164 | ||
1164 | getPerspectiveDistFromElement : { | 1165 | getPerspectiveDistFromElement : { |
1165 | value: function(element, isStage) { | 1166 | value: function(element, isStage) { |
1167 | isStage = false; | ||
1166 | var xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage), | 1168 | var xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage), |
1167 | dist; | 1169 | dist; |
1168 | 1170 | ||
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index f869f65e..f639521c 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js | |||
@@ -1171,7 +1171,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
1171 | var saveLineWidth = this._lineWidth; | 1171 | var saveLineWidth = this._lineWidth; |
1172 | 1172 | ||
1173 | var origLeft = 50; | 1173 | var origLeft = 50; |
1174 | var origTop = 50; | 1174 | var origTop = this.snapManager.getStageHeight() - 50; |
1175 | 1175 | ||
1176 | var mat = this.viewUtils.getMatrixFromElement( this._sourceSpaceElt ); | 1176 | var mat = this.viewUtils.getMatrixFromElement( this._sourceSpaceElt ); |
1177 | var tMat = Matrix.Translation([origLeft,origTop,0]); | 1177 | var tMat = Matrix.Translation([origLeft,origTop,0]); |
@@ -1203,7 +1203,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
1203 | this.setDrawingSurfaceElement(this.application.ninja.stage.layoutCanvas); | 1203 | this.setDrawingSurfaceElement(this.application.ninja.stage.layoutCanvas); |
1204 | // clear just the 3d compass area | 1204 | // clear just the 3d compass area |
1205 | this._drawingContext.save(); | 1205 | this._drawingContext.save(); |
1206 | this._drawingContext.rect(0, 0, 100, 100); | 1206 | this._drawingContext.rect(0, origTop-50, 100, 100); |
1207 | this._drawingContext.clip(); | 1207 | this._drawingContext.clip(); |
1208 | 1208 | ||
1209 | this._drawingContext.lineWidth = 2.0; | 1209 | this._drawingContext.lineWidth = 2.0; |