Skip to content

Commit

Permalink
Add test with more nesting and multiple transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
J.P.P Treub committed Jul 28, 2016
1 parent ada2943 commit 418b162
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/tests/LayerTest.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1199,3 +1199,27 @@ describe "Layer", ->

layerAToLayerBPoint = layerA.convertPointToLayer({}, layerB)
layerAToLayerBPoint.x.should.equal -layerBOffset.y

it "should correctly convert points between multiple layers and transforms", ->

layerA = new Layer
x: 275

layerB = new Layer
y: 400
x: 400
scale: 2
parent: layerA

layerC = new Layer
x: -200
y: 100
rotation: 180
originX: 0
originY: 0
parent: layerB

screenToLayerCPoint = Screen.convertPointToLayer(null, layerC)

point.x.should.equal 112.5
point.y.should.equal 275

0 comments on commit 418b162

Please sign in to comment.