Permalink
Browse files

Add Canvas to layer conversion test

  • Loading branch information...
J.P.P Treub
J.P.P Treub committed Jul 28, 2016
1 parent 418b162 commit 27d8ed3e7944241236264e92cd7c9a481537da8d
Showing with 18 additions and 2 deletions.
  1. +18 −2 test/tests/LayerTest.coffee
@@ -1221,5 +1221,21 @@ describe "Layer", ->
screenToLayerCPoint = Screen.convertPointToLayer(null, layerC)
point.x.should.equal 112.5
point.y.should.equal 275
screenToLayerCPoint.x.should.equal 112.5
screenToLayerCPoint.y.should.equal 275
it "should correctly convert points from the Canvas to a layer", ->
layerA = new Layer
scale: 2
layerB = new Layer
parent: layerA
originY: 1
rotation: 90
canvasToLayerBPoint = Canvas.convertPointToLayer({}, layerB)
canvasToLayerBPoint.x.should.equal -25
canvasToLayerBPoint.y.should.equal 125

0 comments on commit 27d8ed3

Please sign in to comment.