From 3526f28d067bbcfb1f91bd2f86faa478f5f23794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=BE=AE=E4=B8=80=E7=AC=91?= <709648985@qq.com> Date: Fri, 31 Oct 2025 15:35:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=93=9D=E7=89=99=E4=BC=A0?= =?UTF-8?q?=E8=BE=93=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TextToHex/textToDotMatrixFor7305.vue | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) 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