drawLineWithOvershoot = (...args) => {
const [x1, y1, x2, y2, lineWidth, ...rest] = args;
const m = slope(x1, y1, x2, y2);
const angle = Math.atan(m);
const maxExtU = 1 - math.clamp01(math.inverseLerp(5, 1, lineWidth));
const maxExt = lineWidth * math.lerp(4, 0.5, maxExtU);
const ext1 = random.value();
const ext2 = random.value();
let xe1 = x1,
ye1 = y1,
xe2 = x2,
ye2 = y2;
if (m >= 0) {
xe1 = x1 - maxExt * ext1 * Math.cos(angle);
ye1 = y1 - maxExt * ext1 * Math.sin(angle);
xe2 = x2 + maxExt * ext2 * Math.cos(angle);
ye2 = y2 + maxExt * ext2 * Math.sin(angle);
}
drawLine(xe1, ye1, xe2, ye2, lineWidth, ...rest);
}