Skip to content

[Feature] 希望Image图元能添加cellType=image时的keepAspectRatio属性 #4820

@pheasantgogogo

Description

@pheasantgogogo

What problem does this feature solve?

目前定高定宽的Image图元会改变图片比例。
尝试使用外层定宽高的Group的clip裁切然后里面Image居中垂直对齐的方式会有奇怪的问题(添加display="flex" alignItems="center" justifyContent="center"才会出现,不添加不会出现问题),初次渲染没有图片,调用重新绘制的方法也无法显示,手动调整列宽或者快速上下滚动(应该是页面重新渲染了?)才会渲染出来,如下图。
另外开启clip似乎会把外层的Group的阴影属性穿透到内部的Text图元上。

Image

What does the proposed API look like?

希望Image添加一个类似css中object-fit的属性,或者提供一个使用目前的图元实现类似效果的方法,感激。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions