diff options
author | Mike Wilkerson <11575183+mlwilkerson@users.noreply.github.com> | 2020-12-12 08:39:31 -0800 |
---|---|---|
committer | Mike Wilkerson <11575183+mlwilkerson@users.noreply.github.com> | 2020-12-12 08:51:35 -0800 |
commit | fb71b52fa3dc23380d9b168ac40aa7a00f2fe0c9 (patch) | |
tree | facd7a8c003adf5272c49da79951226596376ace /spec | |
parent | b2a0e2bcff2b3a3f568dbd3ec5ce843e217ee6d8 (diff) | |
download | svg.js-fb71b52fa3dc23380d9b168ac40aa7a00f2fe0c9.tar.gz svg.js-fb71b52fa3dc23380d9b168ac40aa7a00f2fe0c9.zip |
fix for arc flags parsing
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/utils/pathParser.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/spec/utils/pathParser.js b/spec/spec/utils/pathParser.js index cc3382d..58d1453 100644 --- a/spec/spec/utils/pathParser.js +++ b/spec/spec/utils/pathParser.js @@ -102,6 +102,32 @@ describe('pathParser.js', () => { [ 'L', 0.3, 0.3 ], [ 'Z' ] ]) + + // "a" commands without optional whitespace around the flag params + expect(pathParser('a32 32 0 00.03-45.22', false)).toEqual([ + [ 'a', 32.0, 32.0, 0.0, 0.0, 0.0, 0.03, -45.22 ], + ]) + + expect(pathParser('a48 48 0 1148-48', false)).toEqual([ + [ 'a', 48.0, 48.0, 0.0, 1.0, 1.0, 48.0, -48.0], + ]) + + expect(pathParser('a82.6 82.6 0 0033.48-20.25', false)).toEqual([ + [ 'a', 82.6, 82.6, 0.0, 0.0, 0.0, 33.48, -20.25 ], + ]) + + expect(pathParser('a82.45 82.45 0 00-20.24 33.47', false)).toEqual([ + [ 'a', 82.45, 82.45, 0.0, 0.0, 0.0, -20.24, 33.47 ], + ]) + + expect(pathParser('a2.51 2.51 0 01.25.32', false)).toEqual([ + [ 'a', 2.51, 2.51, 0, 0, 1, 0.25, 0.32 ], + ]) + + expect(pathParser('a48 48 0 1148-48 48 48 0 01-48 48', false)).toEqual([ + [ 'a', 48.0, 48.0, 0.0, 1.0, 1.0, 48.0, -48.0 ], + [ 'a', 48.0, 48.0, 0.0, 0.0, 1.0, -48.0, 48.0 ] + ]) }) }) }) |