Permalink
Browse files

Renamed `switchTo` to `switchInstant`

  • Loading branch information...
nvh committed Sep 13, 2016
1 parent 44253ef commit 209fec6eacc7a084337e776002729fd2dd9df676
Showing with 6 additions and 6 deletions.
  1. +1 −1 framer/Layer.coffee
  2. +5 −5 test/tests/LayerStatesTest.coffee
View
@@ -942,7 +942,7 @@ class exports.Layer extends BaseClass
animationFinished()
animation
- switchTo: (properties,options={}) ->
+ switchInstant: (properties,options={}) ->
options = _.defaults({instant:true},options)
@animate properties, options
@@ -69,7 +69,7 @@ describe "LayerStates", ->
it "should reset the previous and current states", ->
layer = new Layer
layer.states.test = x: 100
- layer.switchTo 'test'
+ layer.switchInstant 'test'
layer.states =
stateA: x:200
stateB: scale: 0.5
@@ -92,11 +92,11 @@ describe "LayerStates", ->
options:
instant: true
- layer.switchTo "stateA"
+ layer.switchInstant "stateA"
layer.states.currentName.should.equal "stateA"
layer.x.should.equal 123
- layer.switchTo "stateB"
+ layer.switchInstant "stateB"
layer.states.currentName.should.equal "stateB"
layer.y.should.equal 123
@@ -140,14 +140,14 @@ describe "LayerStates", ->
it "should be a no-op to change to the current state", ->
layer = new Layer
layer.states.stateA = {x: 100}
- layer.switchTo 'stateA'
+ layer.switchInstant 'stateA'
animation = layer.animate 'stateA', time: 0.05
assert.equal(animation,null)
it "should change to a state when the properties defined are not the current", (done) ->
layer = new Layer
layer.states.stateA = {x: 100}
- layer.switchTo 'stateA'
+ layer.switchInstant 'stateA'
layer.x = 150
layer.onStateDidSwitch ->
layer.x.should.equal 100

0 comments on commit 209fec6

Please sign in to comment.