Update Elsevier; fix edge case error in 'collinear segments' lint rule (#5175)

This commit is contained in:
Álvaro Mondéjar 2021-03-10 18:52:08 +01:00 committed by GitHub
parent ee606d8ba4
commit a4276d1915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -369,12 +369,20 @@ module.exports = {
cmd = seg[0],
nextCmd = s + 1 < segments.length ? segments[s + 1][0] : null;
if ('LM'.includes(cmd)) {
if (cmd === 'L') {
currAbsCoord[0] = seg[1];
currAbsCoord[1] = seg[2];
} else if ('lm'.includes(cmd)) {
} else if (cmd === 'l') {
currAbsCoord[0] = (!currAbsCoord[0] ? 0 : currAbsCoord[0]) + seg[1];
currAbsCoord[1] = (!currAbsCoord[1] ? 0 : currAbsCoord[1]) + seg[2];
} else if (cmd === 'm') {
currAbsCoord[0] = (!currAbsCoord[0] ? 0 : currAbsCoord[0]) + seg[1];
currAbsCoord[1] = (!currAbsCoord[1] ? 0 : currAbsCoord[1]) + seg[2];
startPoint = undefined;
} else if (cmd === 'M') {
currAbsCoord[0] = seg[1];
currAbsCoord[1] = seg[2];
startPoint = undefined;
} else if (cmd === 'H') {
currAbsCoord[0] = seg[1];
} else if (cmd === 'h') {

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 53 KiB