From cecd95e03941c04484329c714a3a5e6018554048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 7 Aug 2016 21:36:03 +0200 Subject: [PATCH] SVG: Correctly handle multiple sequential move commands. Closes #1134 --- src/path/PathItem.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/path/PathItem.js b/src/path/PathItem.js index aabfaa1d..39a30308 100644 --- a/src/path/PathItem.js +++ b/src/path/PathItem.js @@ -171,12 +171,14 @@ var PathItem = Item.extend(/** @lends PathItem# */{ case 'm': case 'l': var move = lower === 'm'; - for (var j = 0; j < length; j += 2) - this[!j && move ? 'moveTo' : 'lineTo']( - current = getPoint(j)); + for (var j = 0; j < length; j += 2) { + this[move ? 'moveTo' : 'lineTo'](current = getPoint(j)); + if (move) { + start = current; + move = false; + } + } control = current; - if (move) - start = current; break; case 'h': case 'v':