Permalink
Browse files

Make log say Layer on mobile

Instead of MobileScrollFixLayer
  • Loading branch information...
koenbok committed May 13, 2016
1 parent d903cd5 commit b4c7079a0cfaf3ada298443802356908737f4f83
Showing with 22 additions and 20 deletions.
  1. +6 −0 framer/Extras/MobileScrollFix.coffee
  2. +16 −20 framer/Layer.coffee
@@ -47,5 +47,11 @@ exports.enable = ->
@off "touchmove", handleScrollingLayerTouchMove
@off "touchstart", handleScrollingLayerTouchStart
toInspect: ->
if @constructor.name is "MobileScrollFixLayer"
super "Layer"
else
super
# Override the standard window Layer with this patched one
window.Layer = window.Framer.Layer = MobileScrollFixLayer
@@ -159,9 +159,9 @@ class exports.Layer extends BaseClass
@define "ignoreEvents", layerProperty(@, "ignoreEvents", "pointerEvents", true, _.isBoolean)
# Matrix properties
@define "x", layerProperty(@, "x", "webkitTransform", 0, _.isNumber,
@define "x", layerProperty(@, "x", "webkitTransform", 0, _.isNumber,
layerPropertyPointTransformer, {depends: ["width", "height", "parent"]})
@define "y", layerProperty(@, "y", "webkitTransform", 0, _.isNumber,
@define "y", layerProperty(@, "y", "webkitTransform", 0, _.isNumber,
layerPropertyPointTransformer, {depends: ["width", "height", "parent"]})
@define "z", layerProperty(@, "z", "webkitTransform", 0, _.isNumber)
@@ -326,17 +326,17 @@ class exports.Layer extends BaseClass
else
# If there is nothing to work with we exit
return unless input
# Set every numeric value for eacht key
for k in keys
@[k] = input[k] if _.isNumber(input[k])
@[k] = input[k] if _.isNumber(input[k])
@define "point",
importable: true
exportable: false
depends: ["width", "height", "size", "parent"]
get: -> Utils.point(@)
set: (input) ->
set: (input) ->
input = layerPropertyPointTransformer(input, @, "point")
@_setGeometryValues(input, ["x", "y"])
@@ -642,7 +642,7 @@ class exports.Layer extends BaseClass
if currentValue == value
return @emit "load"
# Unset the background color only if it’s the default color
# Unset the background color only if it’s the default color
defaults = Defaults.getDefaults "Layer", {}
if @backgroundColor?.isEqual(defaults.backgroundColor)
@backgroundColor = null
@@ -1148,10 +1148,10 @@ class exports.Layer extends BaseClass
return false
showHint: ->
if not @shouldShowHint()
return _.invoke(@children, "showHint")
color = new Color(40, 175, 250)
layer = new Layer
@@ -1160,12 +1160,12 @@ class exports.Layer extends BaseClass
borderColor: new Color("white").alpha(.5)
borderRadius: @borderRadius * Utils.average([@canvasScaleX(), @canvasScaleY()])
borderWidth: 1
animation = layer.animate
properties:
opacity: 0
time: 0.4
animation.onAnimationEnd ->
layer.destroy()
@@ -1174,13 +1174,9 @@ class exports.Layer extends BaseClass
##############################################################
## DESCRIPTOR
toInspect: ->
round = (value) ->
if parseInt(value) == value
return parseInt(value)
return Utils.round(value, 1)
if @name
return "<#{@constructor.name} id:#{@id} name:#{@name} (#{round(@x)},#{round(@y)}) #{round(@width)}x#{round(@height)}>"
return "<#{@constructor.name} id:#{@id} (#{round(@x)},#{round(@y)}) #{round(@width)}x#{round(@height)}>"
toInspect: (constructor) ->
constructor ?= @constructor.name
name = if @name then "name:#{@name} " else ""
return "<#{constructor} id:#{@id} #{name}
(#{Utils.roundWhole(@x)},#{Utils.roundWhole(@y)})
#{Utils.roundWhole(@width)}x#{Utils.roundWhole(@height)}>"

0 comments on commit b4c7079

Please sign in to comment.