Permalink
Browse files

Fixed problem when empty dasharray was set

  • Loading branch information...
nvh committed Jan 31, 2018
1 parent 23da2bf commit 77dbf873d044b9d09c858aac1b0468321e040575
Showing with 8 additions and 1 deletion.
  1. +1 −1 framer/SVGPath.coffee
  2. +7 −0 test/tests/SVGPathTest.coffee
View
@@ -10,7 +10,7 @@ dashArrayTransform = (value) ->
values = value.split(',')
else
values = value.split(" ")
values = values.map((v) -> parseFloat(v.trim()))
values = values.filter((v) -> v.length > 0).map((v) -> parseFloat(v.trim()))
return values
return value
@@ -31,6 +31,13 @@ describe "SVGPath", ->
point.x.should.be.closeTo 0, 0.01
point.y.should.be.closeTo 50, 0.01
describe "storkeDasharray", ->
it "should work when the dashArray is an empty string", ->
layer = new SVGLayer
svg: """<svg><path stroke-dasharray="" id='test' name='path' d='M 0 0 L 100 200'/>"""
stroke: '#000'
layer.elements.test.strokeDasharray.should.eql []
describe "positioning", ->
it "should proxy the transform property to the SVGLayer if that is it's direct parent", ->
path.x.should.equal 123

0 comments on commit 77dbf87

Please sign in to comment.