Permalink
Browse files

Fix z position bug, thanks Fran

  • Loading branch information...
koenbok committed Jun 8, 2015
1 parent 6bb2038 commit f08d7f68199c76f5e3ab9623a294f58f5dc0167b
Showing with 4 additions and 5 deletions.
  1. +1 −2 framer/LayerStyle.coffee
  2. +3 −3 test/tests/LayerTest.coffee
@@ -81,7 +81,6 @@ exports.LayerStyle =
webkitTransform: (layer) ->
# We have a special rendering path for layers that prefer 2d rendering.
# This definitely decreases performance, but is handy in complex drawing
# scenarios with rounded corners and shadows where gpu drawing gets weird
@@ -91,7 +90,6 @@ exports.LayerStyle =
return exports.LayerStyle.webkitTransformForce2d(layer)
"
translate3d(#{layer._properties.x}px,#{layer._properties.y}px,#{layer._properties.z}px)
scale(#{layer._properties.scale})
scale3d(#{layer._properties.scaleX},#{layer._properties.scaleY},#{layer._properties.scaleZ})
skew(#{layer._properties.skew}deg,#{layer._properties.skew}deg)
@@ -100,6 +98,7 @@ exports.LayerStyle =
rotateX(#{layer._properties.rotationX}deg)
rotateY(#{layer._properties.rotationY}deg)
rotateZ(#{layer._properties.rotationZ}deg)
translate3d(#{layer._properties.x}px,#{layer._properties.y}px,#{layer._properties.z}px)
"
webkitTransformForce2d: (layer) ->
@@ -84,7 +84,7 @@ describe "Layer", ->
layer.y.should.equal 50
# layer.style.webkitTransform.should.equal "matrix(1, 0, 0, 1, 100, 0)"
layer.style.webkitTransform.should.equal "translate3d(100px, 50px, 0px) scale(1) scale3d(1, 1, 1) skew(0deg, 0deg) skewX(0deg) skewY(0deg) rotateX(0deg) rotateY(0deg) rotateZ(0deg)"
layer.style.webkitTransform.should.equal "scale(1) scale3d(1, 1, 1) skew(0deg, 0deg) skewX(0deg) skewY(0deg) rotateX(0deg) rotateY(0deg) rotateZ(0deg) translate3d(100px, 50px, 0px)"
it "should set scale", ->
@@ -95,7 +95,7 @@ describe "Layer", ->
layer.scaleZ = 100
# layer.style.webkitTransform.should.equal "matrix(1, 0, 0, 1, 100, 50)"
layer.style.webkitTransform.should.equal "translate3d(0px, 0px, 0px) scale(1) scale3d(100, 100, 100) skew(0deg, 0deg) skewX(0deg) skewY(0deg) rotateX(0deg) rotateY(0deg) rotateZ(0deg)"
layer.style.webkitTransform.should.equal "scale(1) scale3d(100, 100, 100) skew(0deg, 0deg) skewX(0deg) skewY(0deg) rotateX(0deg) rotateY(0deg) rotateZ(0deg) translate3d(0px, 0px, 0px)"
it "should set origin", ->
@@ -875,7 +875,7 @@ describe "Layer", ->
layer = new Layer
layer.style.webkitTransform.should.equal "translate3d(0px, 0px, 0px) scale(1) scale3d(1, 1, 1) skew(0deg, 0deg) skewX(0deg) skewY(0deg) rotateX(0deg) rotateY(0deg) rotateZ(0deg)"
layer.style.webkitTransform.should.equal "scale(1) scale3d(1, 1, 1) skew(0deg, 0deg) skewX(0deg) skewY(0deg) rotateX(0deg) rotateY(0deg) rotateZ(0deg) translate3d(0px, 0px, 0px)"
layer.force2d = true

0 comments on commit f08d7f6

Please sign in to comment.