Skip to content

Commit

Permalink
Add device.screenSize and better inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbok committed May 11, 2016
1 parent 937b088 commit 9e60469
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions framer/Components/DeviceComponent.coffee
Expand Up @@ -107,6 +107,7 @@ class exports.DeviceComponent extends BaseClass

@_context = new Framer.Context(parent:@content, name:"DeviceScreen")
@_context.perspective = 1200
@_context.device = @

_update: =>

Expand Down Expand Up @@ -207,7 +208,15 @@ class exports.DeviceComponent extends BaseClass
@_update()
@emit("change:fullScreen")

@define "screenSize",
get: ->

if @_shouldRenderFullScreen()
return Canvas.size

return size =
width: @_device.screenWidth
height: @_device.screenHeight

###########################################################################
# DEVICE TYPE
Expand Down Expand Up @@ -551,6 +560,9 @@ class exports.DeviceComponent extends BaseClass

return "#{resourceUrl}/#{hand}.png"

toInspect: ->
return "<Device '#{@deviceType}' #{@screenSize.width}x#{@screenSize.height}>"


###########################################################################
# DEVICE CONFIGURATIONS
Expand Down

0 comments on commit 9e60469

Please sign in to comment.