1
0
Fork 0

chore: Linter run

This commit is contained in:
Joost De Cock 2021-08-30 11:40:16 +02:00
parent e693c7712e
commit ef3bd03e2c
183 changed files with 919 additions and 1838 deletions

View file

@ -429,7 +429,7 @@ Path.prototype.shiftAlong = function (distance, stepsPerMm = 25) {
let op = this.ops[i]
if (op.type === 'line') {
let thisLen = op.to.dist(current)
if (Math.abs((len + thisLen) - distance) < 0.1) return op.to
if (Math.abs(len + thisLen - distance) < 0.1) return op.to
if (len + thisLen > distance) return current.shiftTowards(op.to, distance - len)
len += thisLen
} else if (op.type === 'curve') {
@ -440,8 +440,9 @@ Path.prototype.shiftAlong = function (distance, stepsPerMm = 25) {
{ x: op.to.x, y: op.to.y }
)
let thisLen = bezier.length()
if (Math.abs((len + thisLen) - distance) < 0.1) return op.to
if (len + thisLen > distance) return shiftAlongBezier(distance - len, bezier, thisLen * stepsPerMm)
if (Math.abs(len + thisLen - distance) < 0.1) return op.to
if (len + thisLen > distance)
return shiftAlongBezier(distance - len, bezier, thisLen * stepsPerMm)
len += thisLen
}
current = op.to