降采样适配3.x

Signed-off-by: tsm <2418639820@qq.com>
This commit is contained in:
tsm 2024-05-22 15:46:54 +08:00
parent f62a9ba077
commit 74a574532a
1 changed files with 1 additions and 3 deletions

View File

@ -119,10 +119,8 @@ export struct ImageKnifeComponent {
}
this.pixelMap = pixelMap
if (typeof this.pixelMap !== 'string') {
let info =await this.pixelMap.getImageInfo()
//图片自适应处理
if (this.imageKnifeOption.objectFit === ImageFit.Auto) {
let info =await this.pixelMap.getImageInfo()
this.adaptiveWidth = this.currentWidth
this.adaptiveHeight = info.size.height * this.currentWidth / info.size.width