@leafer-ui/paint 2.0.9 → 2.1.1

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/Compute.ts +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/paint",
3
- "version": "2.0.9",
3
+ "version": "2.1.1",
4
4
  "description": "@leafer-ui/paint",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "2.0.9",
26
- "@leafer-ui/draw": "2.0.9"
25
+ "@leafer/core": "2.1.1",
26
+ "@leafer-ui/draw": "2.1.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "2.0.9",
30
- "@leafer-ui/interface": "2.0.9"
29
+ "@leafer/interface": "2.1.1",
30
+ "@leafer-ui/interface": "2.1.1"
31
31
  }
32
32
  }
package/src/Compute.ts CHANGED
@@ -29,10 +29,10 @@ export function compute(attrName: IPaintAttr, ui: IUI): void {
29
29
  }
30
30
  }
31
31
 
32
- (data as IObject)['_' + attrName] = leafPaints.length ? leafPaints : undefined
33
-
34
32
  if (leafPaints.length) {
35
33
 
34
+ (data as IObject)['_' + attrName] = leafPaints
35
+
36
36
  if (leafPaints.every(item => item.isTransparent)) {
37
37
  if (leafPaints.some(item => item.image)) isAlphaPixel = true
38
38
  isTransparent = true
@@ -48,7 +48,10 @@ export function compute(attrName: IPaintAttr, ui: IUI): void {
48
48
  }
49
49
 
50
50
  } else {
51
- data.__removePaint(attrName, false)
51
+
52
+ data.__removePaint(attrName, false);
53
+ (data as IObject)['_' + attrName] = ''
54
+
52
55
  }
53
56
 
54
57
  }