mirror of
				https://github.com/Mibew/simple-icons.git
				synced 2025-10-31 10:31:06 +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'; | ||||
|               let currLine = [], | ||||
|                   currAbsCoord = [undefined, undefined], | ||||
|                   startPoint, | ||||
|                   _inStraightLine = false, | ||||
|                   _nextInStraightLine = false; | ||||
|                   _nextInStraightLine = false, | ||||
|                   _resetStartPoint = false; | ||||
| 
 | ||||
|               for (let s = 0; s < segments.length; s++) { | ||||
|                 let seg = segments[s], | ||||
| @ -363,11 +365,19 @@ module.exports = { | ||||
|                   currAbsCoord[1] = (!currAbsCoord[1] ? 0 : currAbsCoord[1]) + seg[4]; | ||||
|                 } else if (zCommands.includes(cmd)) { | ||||
|                   // Overlapping in Z should be handled in another rule
 | ||||
|                   currAbsCoord = [undefined, undefined]; | ||||
|                   currAbsCoord = [startPoint[0], startPoint[1]]; | ||||
|                   _resetStartPoint = true; | ||||
|                 } else { | ||||
|                   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); | ||||
|                 let _exitingStraightLine = (_inStraightLine && !_nextInStraightLine); | ||||
|                 _inStraightLine = straightLineCommands.includes(cmd); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user