Skip to content
Permalink
Browse files

Add device.screenSize and better inspect

  • Loading branch information
koenbok committed May 11, 2016
1 parent 937b088 commit 9e604697fe99cbf216918e41f19447e714aec30f
Showing with 12 additions and 0 deletions.
  1. +12 −0 framer/Components/DeviceComponent.coffee
@@ -107,6 +107,7 @@ class exports.DeviceComponent extends BaseClass

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

_update: =>

@@ -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
@@ -551,6 +560,9 @@ class exports.DeviceComponent extends BaseClass

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

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


###########################################################################
# DEVICE CONFIGURATIONS

0 comments on commit 9e60469

Please sign in to comment.