1
0
Fork 0

Merge branch 'develop' into annotations

This commit is contained in:
joostdecock 2023-04-15 15:47:00 +02:00
commit b33a739f54
1392 changed files with 11722 additions and 8413 deletions

View file

@ -192,7 +192,8 @@ Path.prototype.clean = function () {
if (ops.length < this.ops.length) this.ops = ops
return this
// A path with not drawing operations or only a move is not path at all
return ops.length === 0 || (ops.length === 1 && ops[0].type === 'move') ? false : this
}
/**
@ -1310,7 +1311,10 @@ function __pathOffset(path, distance) {
{ x: cp2.x, y: cp2.y },
{ x: op.to.x, y: op.to.y }
)
for (let bezier of b.offset(distance)) offset.push(__asPath(bezier, path.log))
for (let bezier of b.offset(distance)) {
const segment = __asPath(bezier, path.log)
if (segment) offset.push(segment)
}
} else if (op.type === 'close') closed = true
if (op.to) current = op.to
if (!start) start = current