@leafer/image 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/image",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "@leafer/image",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,13 +22,13 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/task": "2.0.2",
26
- "@leafer/file": "2.0.2",
27
- "@leafer/data": "2.0.2",
28
- "@leafer/math": "2.0.2",
29
- "@leafer/platform": "2.0.2"
25
+ "@leafer/task": "2.0.3",
26
+ "@leafer/file": "2.0.3",
27
+ "@leafer/data": "2.0.3",
28
+ "@leafer/math": "2.0.3",
29
+ "@leafer/platform": "2.0.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "2.0.2"
32
+ "@leafer/interface": "2.0.3"
33
33
  }
34
34
  }
@@ -19,6 +19,7 @@ export const ImageManager: IImageManager = {
19
19
  },
20
20
 
21
21
  recycle(image: ILeaferImage): void {
22
+ if (image.parent) image = image.parent // 存在 image filters 的情况
22
23
  image.use--
23
24
  setTimeout(() => {
24
25
  if (!image.use) {
@@ -142,8 +142,11 @@ export class LeaferImage implements ILeaferImage {
142
142
  public getLevelData(_level: number, _width?: number, _height?: number,): ILeaferImageLevel { return undefined }
143
143
  public clearLevels(_checkUse?: boolean): void { }
144
144
 
145
+ public destroyFilter(): void { }
146
+
145
147
  public destroy(): void {
146
148
  this.clearLevels()
149
+ this.destroyFilter()
147
150
 
148
151
  const { view } = this
149
152
  if (view && view.close) view.close() // 可能为 ImageBitmap
package/types/index.d.ts CHANGED
@@ -34,6 +34,7 @@ declare class LeaferImage implements ILeaferImage {
34
34
  getMinLevel(): number;
35
35
  getLevelData(_level: number, _width?: number, _height?: number): ILeaferImageLevel;
36
36
  clearLevels(_checkUse?: boolean): void;
37
+ destroyFilter(): void;
37
38
  destroy(): void;
38
39
  }
39
40