Skip to content
Permalink
Browse files

Make sure the default backgroundColor is also cleared when using grad…

…ients
  • Loading branch information
Jonas Treub
Jonas Treub committed Jun 28, 2017
1 parent 8df882d commit 9e3aedad069646cc5dfc7b70d15a1c4d3f0c050c
Showing with 5 additions and 5 deletions.
  1. +5 −5 framer/Layer.coffee
@@ -886,6 +886,11 @@ class exports.Layer extends BaseClass
@_getPropertyValue "image"
set: (value) ->

# 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)
@@ -901,11 +906,6 @@ class exports.Layer extends BaseClass
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

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

0 comments on commit 9e3aeda

Please sign in to comment.
You can’t perform that action at this time.