solve = {
const context = DOM.context2d(1, height, 1);
return function(line) {
const p = new Path2D(line);
return function(x) {
context.save();
context.clearRect(0, 0, 1, height);
context.translate(-x, 0);
context.stroke(p);
context.restore();
const data = context.getImageData(0, 0, 1, height).data;
for (let y = 0; y < height; y++)
if (data[4 * y + 3]) {
return y + (1 - data[4 * y + 3] / 255);
}
};
};
}