merge upstream
This commit is contained in:
@ -149,26 +149,28 @@
|
|||||||
// 5. 异步绘制并获取像素数据(串行处理避免冲突)
|
// 5. 异步绘制并获取像素数据(串行处理避免冲突)
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
ctx.draw(false, () => {
|
ctx.draw(false, () => {
|
||||||
uni.canvasGetImageData({
|
setTimeout(() => {
|
||||||
canvasId: 'reusableCanvas',
|
uni.canvasGetImageData({
|
||||||
x: 0,
|
canvasId: 'reusableCanvas',
|
||||||
y: 0,
|
x: 0,
|
||||||
width: this.currentCanvasWidth,
|
y: 0,
|
||||||
height: this.currentCanvasHeight,
|
width: this.currentCanvasWidth,
|
||||||
success: res => {
|
height: this.currentCanvasHeight,
|
||||||
result = {
|
success: res => {
|
||||||
line: textLine,
|
result = {
|
||||||
pixelData: res.data,
|
line: textLine,
|
||||||
width: this.currentCanvasWidth,
|
pixelData: res.data,
|
||||||
height: this.currentCanvasHeight
|
width: this.currentCanvasWidth,
|
||||||
};
|
height: this.currentCanvasHeight
|
||||||
resolve();
|
};
|
||||||
},
|
resolve();
|
||||||
fail: err => {
|
},
|
||||||
// console.error(`处理第${i+1}行失败:`, err);
|
fail: err => {
|
||||||
reject(err)
|
// console.error(`处理第${i+1}行失败:`, err);
|
||||||
}
|
reject(err)
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user