Skip to content

Commit

Permalink
Fix rotation bug with device
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbok committed Jan 14, 2015
1 parent f932e94 commit 45d792d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion extras/CactusFramer/static/app.coffee
Original file line number Diff line number Diff line change
@@ -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()
11 changes: 10 additions & 1 deletion framer/DeviceView.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 45d792d

Please sign in to comment.