Skip to content
Permalink
Browse files

Fix for iPhoneX screen size being off

  • Loading branch information...
nvh committed Apr 5, 2018
1 parent a269379 commit 9d4b6cd2f8e7f61dad59baecbb05e7f4bc503c06
Showing with 7 additions and 3 deletions.
  1. +7 −3 framer/Components/DeviceComponent.coffee
@@ -147,9 +147,13 @@ class exports.DeviceComponent extends BaseClass
contentScaleFactor = 1 if contentScaleFactor > 1
screenSizeChanged = false
if @_shouldRenderFullScreen()

width = document.documentElement.clientWidth / contentScaleFactor
height = document.documentElement.clientHeight / contentScaleFactor
if Utils.isMobile()
# This uses the actual screen size, which only make sense if the prototype takes up the whole screen of the device
width = screen.width * window.devicePixelRatio
height = screen.height * window.devicePixelRatio
else
width = document.documentElement.clientWidth / contentScaleFactor
height = document.documentElement.clientHeight / contentScaleFactor
screenSizeChanged = @content.width isnt width or @content.height isnt height
for layer in [@background, @hands, @phone, @viewport, @content, @screen, @screenMask]
layer.x = layer.y = 0

0 comments on commit 9d4b6cd

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