mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-02-21 16:34:33 +03:00
Fix absolute coordinate error in 'collinear-segments' lint (#4692)
* Fix absolute coordinate error in 'collinear-segments' lint * Add New Japan Pro-Wrestling to 'svglint-ignored.json'
This commit is contained in:
parent
7a401fd889
commit
d6ee5f47d5
File diff suppressed because one or more lines are too long
@ -327,8 +327,10 @@ module.exports = {
|
|||||||
zCommands = 'Zz';
|
zCommands = 'Zz';
|
||||||
let currLine = [],
|
let currLine = [],
|
||||||
currAbsCoord = [undefined, undefined],
|
currAbsCoord = [undefined, undefined],
|
||||||
|
startPoint,
|
||||||
_inStraightLine = false,
|
_inStraightLine = false,
|
||||||
_nextInStraightLine = false;
|
_nextInStraightLine = false,
|
||||||
|
_resetStartPoint = false;
|
||||||
|
|
||||||
for (let s = 0; s < segments.length; s++) {
|
for (let s = 0; s < segments.length; s++) {
|
||||||
let seg = segments[s],
|
let seg = segments[s],
|
||||||
@ -363,11 +365,19 @@ module.exports = {
|
|||||||
currAbsCoord[1] = (!currAbsCoord[1] ? 0 : currAbsCoord[1]) + seg[4];
|
currAbsCoord[1] = (!currAbsCoord[1] ? 0 : currAbsCoord[1]) + seg[4];
|
||||||
} else if (zCommands.includes(cmd)) {
|
} else if (zCommands.includes(cmd)) {
|
||||||
// Overlapping in Z should be handled in another rule
|
// Overlapping in Z should be handled in another rule
|
||||||
currAbsCoord = [undefined, undefined];
|
currAbsCoord = [startPoint[0], startPoint[1]];
|
||||||
|
_resetStartPoint = true;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`"${cmd}" command not handled`)
|
throw new Error(`"${cmd}" command not handled`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (startPoint === undefined) {
|
||||||
|
startPoint = [currAbsCoord[0], currAbsCoord[1]];
|
||||||
|
} else if (_resetStartPoint) {
|
||||||
|
startPoint = undefined;
|
||||||
|
_resetStartPoint = false;
|
||||||
|
}
|
||||||
|
|
||||||
_nextInStraightLine = straightLineCommands.includes(nextCmd);
|
_nextInStraightLine = straightLineCommands.includes(nextCmd);
|
||||||
let _exitingStraightLine = (_inStraightLine && !_nextInStraightLine);
|
let _exitingStraightLine = (_inStraightLine && !_nextInStraightLine);
|
||||||
_inStraightLine = straightLineCommands.includes(cmd);
|
_inStraightLine = straightLineCommands.includes(cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user