Skip to content
Permalink
Browse files

Fix rotation bug with device

  • Loading branch information...
koenbok committed Jan 14, 2015
1 parent f932e94 commit 45d792d1cb988e44d788fef5280f2df823b99070
Showing with 15 additions and 2 deletions.
  1. +5 −1 extras/CactusFramer/static/app.coffee
  2. +10 −1 framer/DeviceView.coffee
@@ -1,2 +1,6 @@
Framer.Device = new Framer.DeviceView()
Framer.Device.setupContext()
Framer.Device.setupContext()

layer = new Layer width:10000, height:10000

Framer.Device.rotateRight()
@@ -403,19 +403,28 @@ class exports.DeviceView extends BaseClass
@phone.animateStop()
@viewport.animateStop()

# FIXME: After a rotation we call _update() again to set all the right
# dimensions, but these should be correctly animated instead of set after
# the animation.

if animate
animation = @phone.animate _.extend @animationOptions,
properties: phoneProperties
@viewport.animate _.extend @animationOptions,
properties: contentProperties

animation.on Events.AnimationEnd, =>
@_update()

if _hadKeyboard
animation.on Events.AnimationEnd, =>
@showKeyboard(true)

else
@phone.properties = phoneProperties
@viewport.properties = contentProperties

@_update()

if _hadKeyboard
@showKeyboard(true)

0 comments on commit 45d792d

Please sign in to comment.
You can’t perform that action at this time.