()
| 857 | |
| 858 | |
| 859 | updateGridDisplay() { |
| 860 | if (!this.processedCanvas || !this.basePixelCanvas) return; |
| 861 | |
| 862 | // 重绘基础图像 |
| 863 | const ctx = this.processedCanvas.getContext('2d'); |
| 864 | ctx.imageSmoothingEnabled = false; |
| 865 | ctx.clearRect(0, 0, this.processedCanvas.width, this.processedCanvas.height); |
| 866 | ctx.drawImage(this.basePixelCanvas, 0, 0); |
| 867 | |
| 868 | // 绘制网格 |
| 869 | if (document.getElementById('showPixelGrid').checked) { |
| 870 | this.drawGrid(this.processedCanvas); |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | drawGrid(canvas) { |
| 875 | const ctx = canvas.getContext('2d'); |
no test coverage detected