MCPcopy Create free account
hub / github.com/32comic/image2pixel-web / updateGridDisplay

Method updateGridDisplay

pixelizer.js:859–872  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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');

Callers 3

showPreviewMethod · 0.95
updatePreviewIfNeededMethod · 0.95

Calls 1

drawGridMethod · 0.95

Tested by

no test coverage detected