更新时间:2022-05-09 04:45:48
已解决。我不得不在画布创建之后更改画布大小:
Solved. I had to change the canvas size just after canvas creation:
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
var size = 56;
canvas.height = size;
canvas.width = size;
https://jsfiddle.net/03h4fyka/1/
对WestLangley的信用。我有另一个问题,我会把它发布在另一个问题。
Credits to WestLangley. I have another problem, I'll post it in another question.