Skip to content

Commit 88f1d9c

Browse files
authored
Merge pull request #5219 from BigBuckBunny12/fix/invalid-svg-path-edge-case
Fix concat error for SVG paths starting in M 0 0
2 parents 127d4c4 + 0197236 commit 88f1d9c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/modules/Graphics.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,8 @@ class Graphics {
501501
initialAnim && this.w.config.chart.animations.dynamicAnimation.enabled
502502

503503
// Fix for paths starting with M 0 0
504-
if (pathFrom && pathFrom.startsWith('M 0 0') && pathTo) {
504+
// Extra space avoids matching decimal values like "M 0 0.239"
505+
if (pathFrom && pathFrom.startsWith('M 0 0 ') && pathTo) {
505506
const moveCommand = pathTo.match(/^M\s+[\d.-]+\s+[\d.-]+/)
506507
if (moveCommand) {
507508
pathFrom = pathFrom.replace(/^M\s+0\s+0/, moveCommand[0])

0 commit comments

Comments
 (0)