提交 628c1e18 编写于 作者: Q qiang

fix: 修复 getImageData 图像大小

上级 72587c5a
<template>
<uni-canvas
:canvas-id="canvasId"
:disable-scroll="disableScroll"
<uni-canvas
:canvas-id="canvasId"
:disable-scroll="disableScroll"
v-on="_listeners">
<canvas
ref="canvas"
width="300"
<canvas
ref="canvas"
width="300"
height="150" />
<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden;">
<slot />
</div>
<v-uni-resize-sensor
ref="sensor"
<v-uni-resize-sensor
ref="sensor"
@resize="_resize" />
</uni-canvas>
</template>
......@@ -425,6 +425,7 @@ export default {
context.drawImageByCanvas(canvas, x, y, width, height, 0, 0, destWidth, destHeight, false)
imgData = context.getImageData(0, 0, destWidth, destHeight)
newCanvas.height = newCanvas.width = 0
context.__hidpi__ = false
} catch (error) {
if (!callbackId) {
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册