Skip to content

Commit

Permalink
Fix image flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Treub committed Jun 28, 2017
1 parent 9e3aeda commit f32e84e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions framer/Layer.coffee
Expand Up @@ -886,13 +886,16 @@ class exports.Layer extends BaseClass
@_getPropertyValue "image"
set: (value) ->

currentValue = @_getPropertyValue "image"

if currentValue is value
return @emit "load"

# Unset the background color only if it’s the default color
defaults = Defaults.getDefaults "Layer", {}
if @backgroundColor?.isEqual(defaults.backgroundColor)
@backgroundColor = null

currentValue = @_getPropertyValue "image"

if LinearGradient.isLinearGradient(value)
@emit("change:gradient", value, currentValue)
@emit("change:image", value, currentValue)
Expand All @@ -903,9 +906,6 @@ class exports.Layer extends BaseClass
if not (_.isString(value) or value is null)
layerValueTypeError("image", value)

if currentValue is value
return @emit "load"

# Set the property value
@_setPropertyValue("image", value)
if value in [null, ""]
Expand Down

0 comments on commit f32e84e

Please sign in to comment.