Permalink
Browse files

Merge pull request #271 from koenbok/check-setter-equal

Don't set the same values for layer
  • Loading branch information...
koenbok committed Dec 15, 2015
2 parents d38fcf7 + 2e2c742 commit 674c81cbc45c9ac435a8d54fc5b8953f12eb566d
Showing with 7 additions and 4 deletions.
  1. +7 −4 framer/Layer.coffee
@@ -22,19 +22,22 @@ layerProperty = (obj, name, cssProperty, fallback, validator, transformer, optio
result =
default: fallback
get: ->
# console.log "Layer.#{name}.get #{@_properties[name]}", @_properties.hasOwnProperty(name)
return @_properties[name] if @_properties.hasOwnProperty(name)
return fallback
set: (value) ->
# console.log "Layer.#{name}.set #{value}"
# console.log "Layer.#{name}.set #{value} current:#{@[name]}"
if value and transformer
value = transformer(value)
else if value == null and transformer
if transformer and (value or value is null)
value = transformer(value)
# Return unless we get a new value
return if value is @_properties[name]
if value and validator and not validator(value)
layerValueTypeError(name, value)

0 comments on commit 674c81c

Please sign in to comment.