1
0
Fork 0

🐛 Increased control point shift to avoid collisions in offset

This commit is contained in:
Joost De Cock 2018-09-04 10:26:27 +02:00
parent 6c20fa1325
commit 336e0a4248

View file

@ -240,13 +240,13 @@ function pathOffset(path, distance) {
cp1 = new Path() cp1 = new Path()
.move(current) .move(current)
.curve(op.cp1, op.cp2, op.to) .curve(op.cp1, op.cp2, op.to)
.shiftAlong(1); .shiftAlong(2);
} else cp1 = op.cp1; } else cp1 = op.cp1;
if (op.cp2.sitsOn(op.to)) { if (op.cp2.sitsOn(op.to)) {
cp2 = new Path() cp2 = new Path()
.move(op.to) .move(op.to)
.curve(op.cp2, op.cp1, current) .curve(op.cp2, op.cp1, current)
.shiftAlong(1); .shiftAlong(2);
} else cp2 = op.cp2; } else cp2 = op.cp2;
let b = new Bezier( let b = new Bezier(
{ x: current.x, y: current.y }, { x: current.x, y: current.y },