提交 2e0b1101 编写于 作者: D DCloud_LXH

fix: canvas resize precision problem

上级 2e3ba776
......@@ -135,7 +135,7 @@ export default {
},
_resize (size) {
var canvas = this.$refs.canvas
var hasChanged = !size || (canvas.width !== size.width * pixelRatio || canvas.height !== size.height * pixelRatio)
var hasChanged = !size || (canvas.width !== Math.floor(size.width * pixelRatio) || canvas.height !== Math.floor(size.height * pixelRatio))
if (!hasChanged) return
if (canvas.width > 0 && canvas.height > 0) {
var context = canvas.getContext('2d')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册