diff --git a/components/TextToHex/textToDotMatrixFor7305.vue b/components/TextToHex/textToDotMatrixFor7305.vue index 7160bf5..6fc362b 100644 --- a/components/TextToHex/textToDotMatrixFor7305.vue +++ b/components/TextToHex/textToDotMatrixFor7305.vue @@ -1,6 +1,6 @@ @@ -149,28 +149,26 @@ // 5. 异步绘制并获取像素数据(串行处理避免冲突) await new Promise((resolve, reject) => { ctx.draw(false, () => { - setTimeout(() => { - uni.canvasGetImageData({ - canvasId: 'reusableCanvas', - x: 0, - y: 0, - width: this.currentCanvasWidth, - height: this.currentCanvasHeight, - success: res => { - result = { - line: textLine, - pixelData: res.data, - width: this.currentCanvasWidth, - height: this.currentCanvasHeight - }; - resolve(); - }, - fail: err => { - // console.error(`处理第${i+1}行失败:`, err); - reject(err) - } - }); - }, 100); + uni.canvasGetImageData({ + canvasId: 'reusableCanvas', + x: 0, + y: 0, + width: this.currentCanvasWidth, + height: this.currentCanvasHeight, + success: res => { + result = { + line: textLine, + pixelData: res.data, + width: this.currentCanvasWidth, + height: this.currentCanvasHeight + }; + resolve(); + }, + fail: err => { + // console.error(`处理第${i+1}行失败:`, err); + reject(err) + } + }); }); }); @@ -202,6 +200,5 @@ position: fixed; left: -9999px; top: -9999px; - visibility: hidden; } \ No newline at end of file