diff --git a/src/shapes/path.class.js b/src/shapes/path.class.js index 823a80e6..a0feb0de 100644 --- a/src/shapes/path.class.js +++ b/src/shapes/path.class.js @@ -18,6 +18,10 @@ q: 4, t: 2, a: 7 + }, + repeatedCommands = { + m: 'l', + M: 'L' }; if (fabric.Path) { @@ -586,12 +590,14 @@ } } - var command = coordsParsed[0].toLowerCase(), - commandLength = commandLengths[command]; + var command = coordsParsed[0], + commandLength = commandLengths[command.toLowerCase()], + repeatedCommand = repeatedCommands[command] || command; if (coordsParsed.length - 1 > commandLength) { for (var k = 1, klen = coordsParsed.length; k < klen; k += commandLength) { - result.push([ coordsParsed[0] ].concat(coordsParsed.slice(k, k + commandLength))); + result.push([ command ].concat(coordsParsed.slice(k, k + commandLength))); + command = repeatedCommand; } } else {