diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-04-25 12:05:49 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-04-25 12:05:49 +0200 |
commit | 9325620c17dd1e926c5e43e8425cea4fbaad3835 (patch) | |
tree | 9035731d6de9e0ed3625f57cce1c84858fadac4a /spec | |
parent | 04e21b18c30d546ed6a16b279504a2b58b503541 (diff) | |
download | svg.js-9325620c17dd1e926c5e43e8425cea4fbaad3835.tar.gz svg.js-9325620c17dd1e926c5e43e8425cea4fbaad3835.zip |
fixed a bug in path parser which made it stop parsing when hitting z command (#665)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/array.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/spec/array.js b/spec/spec/array.js index addda87..7530ea1 100644 --- a/spec/spec/array.js +++ b/spec/spec/array.js @@ -235,9 +235,8 @@ describe('PathArray', function () { p2 = new SVG.PathArray('m10 80 c 40 10 65 10 95 80 s 150 150 180 80 t 300 300 q 52 10 95 80 z') p3 = new SVG.PathArray('m80 80 A 45 45, 0, 0, 0, 125 125 L 125 80 z') p4 = new SVG.PathArray('M215.458,245.23c0,0,77.403,0,94.274,0S405,216.451,405,138.054S329.581,15,287.9,15c-41.68,0-139.924,0-170.688,0C86.45,15,15,60.65,15,134.084c0,73.434,96.259,112.137,114.122,112.137C146.984,246.221,215.458,245.23,215.458,245.23z') - p5 = new SVG.PathArray( - 'M10 10-45-30.5.5 .89L2e-2.5.5.5-.5C.5.5.5.5.5.5L-3-4z' - ) + p5 = new SVG.PathArray('M10 10-45-30.5.5 .89L2e-2.5.5.5-.5C.5.5.5.5.5.5L-3-4z') + p6 = new SVG.PathArray('m 0,0 0,3189 2209,0 0,-3189 -2209,0 z m 154,154 1901,0 0,2881 -1901,0 0,-2881 z') }) @@ -246,6 +245,7 @@ describe('PathArray', function () { expect(p2.toString()).toBe('M10 80C50 90 75 90 105 160S255 310 285 240T585 540Q637 550 680 620Z ') expect(p3.toString()).toBe('M80 80A45 45 0 0 0 125 125L125 80Z ') expect(p4.toString()).toBe('M215.458 245.23C215.458 245.23 292.861 245.23 309.73199999999997 245.23S405 216.451 405 138.054S329.581 15 287.9 15C246.21999999999997 15 147.97599999999997 15 117.21199999999999 15C86.45 15 15 60.65 15 134.084C15 207.518 111.259 246.221 129.122 246.221C146.984 246.221 215.458 245.23 215.458 245.23Z ') + expect(p6.toString()).toBe('M0 0L0 3189L2209 3189L2209 0L0 0ZM154 154L2055 154L2055 3035L154 3035L154 154Z ') }) it('parses difficult syntax correctly', function() { |