forked from floraachy/ImageKnife
disAppear生命周期清空定时器只在gif图片时执行
Signed-off-by: zenggaofeng <zenggaofeng2@h-partners.com>
This commit is contained in:
parent
f5f238df40
commit
ec07480c42
|
@ -2,6 +2,7 @@
|
||||||
- 使用taskpool实现多线程加载图片资源
|
- 使用taskpool实现多线程加载图片资源
|
||||||
- 修复部分gif图片识别成静态图
|
- 修复部分gif图片识别成静态图
|
||||||
- 修复同一张图片发送多次请求
|
- 修复同一张图片发送多次请求
|
||||||
|
- disAppear生命周期清空定时器只在gif图片时执行
|
||||||
|
|
||||||
## 2.1.2-rc.8
|
## 2.1.2-rc.8
|
||||||
- onAreaChange绘制图片改为component Util绘制
|
- onAreaChange绘制图片改为component Util绘制
|
||||||
|
|
|
@ -51,6 +51,8 @@ export struct ImageKnifeComponent {
|
||||||
// 抗锯齿属性
|
// 抗锯齿属性
|
||||||
private imageSmoothingQuality: ImageSmoothingQuality = 'low';
|
private imageSmoothingQuality: ImageSmoothingQuality = 'low';
|
||||||
private imageSmoothingEnabled: boolean = true;
|
private imageSmoothingEnabled: boolean = true;
|
||||||
|
// 是否是gif图片
|
||||||
|
private isGif: boolean = false
|
||||||
@State keyCanvas: KeyCanvas = {
|
@State keyCanvas: KeyCanvas = {
|
||||||
keyId: util.generateRandomUUID()
|
keyId: util.generateRandomUUID()
|
||||||
}
|
}
|
||||||
|
@ -197,6 +199,11 @@ export struct ImageKnifeComponent {
|
||||||
request.load(this.imageKnifeOption.loadSrc)
|
request.load(this.imageKnifeOption.loadSrc)
|
||||||
.addListener({ callback: (err:BusinessError|string, data:ImageKnifeData) => {
|
.addListener({ callback: (err:BusinessError|string, data:ImageKnifeData) => {
|
||||||
LogUtil.log('ImageKnifeComponent request.load callback')
|
LogUtil.log('ImageKnifeComponent request.load callback')
|
||||||
|
if(data.isGIFFrame()) {
|
||||||
|
this.isGif = true
|
||||||
|
} else {
|
||||||
|
this.isGif = false
|
||||||
|
}
|
||||||
this.runNextFunction(this.displayMainSource,data);
|
this.runNextFunction(this.displayMainSource,data);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -648,7 +655,9 @@ export struct ImageKnifeComponent {
|
||||||
if (this.detachFromLayoutPixelMap != undefined) {
|
if (this.detachFromLayoutPixelMap != undefined) {
|
||||||
this.detachFromLayoutPixelMap.detach();
|
this.detachFromLayoutPixelMap.detach();
|
||||||
}
|
}
|
||||||
this.resetGifData();
|
if(this.isGif){
|
||||||
|
this.resetGifData();
|
||||||
|
}
|
||||||
this.listener.off("layout",this.onLayoutComplete)
|
this.listener.off("layout",this.onLayoutComplete)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue