Permalink
Browse files

Setting the backgroundColor of an SVGLayer to null if the svg is set

  • Loading branch information...
nvh committed Dec 17, 2017
1 parent 2aa68af commit 3575b95cc6970aab6bb9bf762392f27c7d46bdba
Showing with 22 additions and 0 deletions.
  1. +2 −0 framer/SVGLayer.coffee
  2. +20 −0 test/tests/SVGLayerTest.coffee
View
@@ -22,6 +22,8 @@ class exports.SVGLayer extends Layer
options.color ?= options.backgroundColor
options.backgroundColor = null
options.clip ?= false
if options.svg? or options.html?
options.backgroundColor ?= null
super options
@updateGradientSVG()
@@ -37,6 +37,26 @@ describe "SVGLayer", ->
a.clip.should.be.true
a._element.style.overflow.should.equal("hidden")
it "should use the default backgroundColor when not providing SVG", ->
a = new SVGLayer
a.backgroundColor.should.equalColor Framer.Defaults.Layer.backgroundColor
it "should set the backgroundColor to null when providing SVG", ->
a = new SVGLayer
svg: svgString
expect(a.backgroundColor).to.be.null
it "should allow overriding the backgroundColor to null when providing SVG", ->
a = new SVGLayer
svg: svgString
backgroundColor: "blue"
a.backgroundColor.should.equalColor "blue"
it "should set the backgroundColor to null when providing SVG", ->
a = new SVGLayer
html: svgString
expect(a.backgroundColor).to.be.null
describe "svg", ->
describe "getter", ->
it "should return the SVG node", ->

0 comments on commit 3575b95

Please sign in to comment.