Open mightyroy opened 2 years ago
我在用苹果Safari。
问题解决了,global.js 里的 drawPoint 需要更新:
function drawPoint(context, x, y, color = '#f00', width = 1) {
context.beginPath();
context.lineCap = 'round';
context.moveTo(x-0.1, y-0.1);
context.lineTo(x+0.1, y+0.1);
context.closePath();
context.lineWidth = width;
context.strokeStyle = color;
context.stroke();
}
为什么要加减0.1呢?
我这个成功了:
function drawPoint(context, x, y, color = '#f00', width = 1) { context.beginPath(); context.lineCap = 'round'; context.moveTo(x-5, y); context.lineTo(x +5, y); context.moveTo(x, y-5); context.lineTo(x, y + 5); context.closePath(); context.lineWidth = width; context.strokeStyle = color; context.stroke();
}
我弄了29多个point, 你看number已经30了,但是没有什么point出现!