Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add device.screenSize and better inspect
- Loading branch information
Showing
with
12 additions
and
0 deletions.
-
+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 |
|
|