Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixed problem when empty dasharray was set
- Loading branch information
Showing
with
8 additions
and
1 deletion.
-
+1
−1
framer/SVGPath.coffee
-
+7
−0
test/tests/SVGPathTest.coffee
|
@@ -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 |
|
|