提交 99d1979e 编写于 作者: Q qiang

fix: 修复 uni.canvasToTempFilePath 配置的大小超过 canvas 大小时获取的图像空白的问题 question/111225

上级 e7320b24
......@@ -365,12 +365,10 @@ export default {
}) {
const canvas = this.$refs.canvas
let data
if (!width) {
width = canvas.offsetWidth - x
}
if (!height) {
height = canvas.offsetHeight - y
}
const maxWidth = canvas.offsetWidth - x
width = width ? Math.min(width, maxWidth) : maxWidth
const maxHeight = canvas.offsetHeight - y
height = height ? Math.min(height, maxWidth) : maxHeight
if (!hidpi) {
if (!destWidth && !destHeight) {
destWidth = Math.round(width * pixelRatio)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册