forked from floraachy/ImageKnife
修复宽高不等svg图片显示有毛边
Signed-off-by: zgf <zenggaofeng2@h-partners.com>
This commit is contained in:
parent
fa59e2b9ac
commit
906337cc62
|
@ -1,3 +1,6 @@
|
||||||
|
## 3.1.0-rc.2
|
||||||
|
- 修复宽高不等svg图片显示有毛边
|
||||||
|
|
||||||
## 3.1.0-rc.1
|
## 3.1.0-rc.1
|
||||||
- ImageKnifeAnimatorComponent新增开始、结束、暂停的回调事件
|
- ImageKnifeAnimatorComponent新增开始、结束、暂停的回调事件
|
||||||
- 文件缓存数量负数和超过INT最大值时默认为INT最大值
|
- 文件缓存数量负数和超过INT最大值时默认为INT最大值
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"main": "index.ets",
|
"main": "index.ets",
|
||||||
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
|
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "3.1.0-rc.1",
|
"version": "3.1.0-rc.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ohos/gpu_transform": "^1.0.2"
|
"@ohos/gpu_transform": "^1.0.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -626,10 +626,12 @@ async function requestJob(request: RequestJobRequest, requestList?: List<ImageKn
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else if(typeValue == "svg") {
|
} else if(typeValue == "svg") {
|
||||||
|
let size = (await imageSource.getImageInfo()).size
|
||||||
|
let scale = size.height / size.width
|
||||||
let hValue = Math.round(request.componentHeight);
|
let hValue = Math.round(request.componentHeight);
|
||||||
let wValue = Math.round(request.componentWidth);
|
let wValue = Math.round(request.componentWidth);
|
||||||
let defaultSize: image.Size = {
|
let defaultSize: image.Size = {
|
||||||
height: vp2px(hValue),
|
height: vp2px(wValue) * scale,
|
||||||
width: vp2px(wValue)
|
width: vp2px(wValue)
|
||||||
};
|
};
|
||||||
let opts: image.DecodingOptions = {
|
let opts: image.DecodingOptions = {
|
||||||
|
|
Loading…
Reference in New Issue