在 left:0 和 top:0 的情况下,图片类型渲染 objectFit: 'cover' 异常
auven opened this issue · comments
张剑™ commented
问题描述
使用版本 1.0.0-beta.1
复现步骤
{
"type": "container",
"direction": "vertical",
"top": 0,
"left": 0,
"children": [
{
"type": "image",
"src": "/static/demo.png",
"width": 200,
"height": 300,
"top": 0,
"left": 0,
"objectFit": "cover",
"objectPosition": [
"center",
"top"
]
}
]
}
要给 top 和 left 设置大于0才正常,如下两种情况都可以
{
"type": "container",
"direction": "vertical",
"top": 0.01,
"left": 0.01,
"children": [
{
"type": "image",
"src": "/static/demo.png",
"width": 200,
"height": 300,
"top": 0,
"left": 0,
"objectFit": "cover",
"objectPosition": [
"center",
"top"
]
}
]
}
{
"type": "container",
"direction": "vertical",
"top": 0,
"left": 0,
"children": [
{
"type": "image",
"src": "/static/demo.png",
"width": 200,
"height": 300,
"top": 0.01,
"left": 0.01,
"objectFit": "cover",
"objectPosition": [
"center",
"top"
]
}
]
}
小程序和H5端都会。