提交 319a27e4 编写于 作者: H hdx

test(canvas): 修正逻辑错误

上级 9a35e485
...@@ -114,8 +114,13 @@ ...@@ -114,8 +114,13 @@
this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg') this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg')
}, 'image/jpeg', 0.95); }, 'image/jpeg', 0.95);
// #endif // #endif
// #ifdef WEB || MP // #ifdef APP-IOS || APP-HARMONY || WEB || MP
this.testToDataURLResult = this.canvasContext!.toDataURL().startsWith('data:image/png;base64') this.testToDataURLResult = this.canvasContext!.toDataURL().startsWith('data:image/png;base64')
// #endif
// #ifdef APP-ANDROID
setTimeout(() => {
this.testToDataURLResult = this.canvasContext!.toDataURL().startsWith('data:image/png;base64')
}, 50)
// #endif // #endif
this.testCanvasContext = true this.testCanvasContext = true
} }
...@@ -124,11 +129,6 @@ ...@@ -124,11 +129,6 @@
uni.$on('canvasChildReady', this.onChildReady) uni.$on('canvasChildReady', this.onChildReady)
}, },
onReady() { onReady() {
// TODO app-android 需要延迟调用
// #ifdef APP
this.testToDataURLResult = this.canvasContext!.toDataURL().startsWith('data:image/png;base64')
// #endif
// 同步调用方式,仅支持 app/web // 同步调用方式,仅支持 app/web
// let canvas = uni.getElementById("canvas") as UniCanvasElement // let canvas = uni.getElementById("canvas") as UniCanvasElement
// this.renderingContext = canvas.getContext("2d") // this.renderingContext = canvas.getContext("2d")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册