@leafer-ui/paint 2.0.1 → 2.0.2

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.1",
3
+ "version": "2.0.2",
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.1",
26
- "@leafer-ui/draw": "2.0.1"
25
+ "@leafer/core": "2.0.2",
26
+ "@leafer-ui/draw": "2.0.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "2.0.1",
30
- "@leafer-ui/interface": "2.0.1"
29
+ "@leafer/interface": "2.0.2",
30
+ "@leafer-ui/interface": "2.0.2"
31
31
  }
32
32
  }
package/src/Compute.ts CHANGED
@@ -58,12 +58,15 @@ function getLeafPaint(attrName: string, paint: IPaint, ui: IUI): ILeafPaint {
58
58
  if (!isObject(paint) || paint.visible === false || paint.opacity === 0) return undefined
59
59
 
60
60
  let leafPaint: ILeafPaint
61
- const { boxBounds } = ui.__layout
61
+ const { boxBounds } = ui.__layout, { type } = paint
62
62
 
63
- switch (paint.type) {
63
+ switch (type) {
64
64
  case 'image':
65
+ case 'film':
66
+ case 'video':
65
67
  if (!paint.url) return undefined
66
68
  leafPaint = PaintImage.image(ui, attrName, paint, boxBounds, !recycleMap || !recycleMap[paint.url])
69
+ if (type !== 'image') PaintImage[type](leafPaint)
67
70
  break
68
71
  case 'linear':
69
72
  leafPaint = PaintGradient.linearGradient(paint, boxBounds)
@@ -75,7 +78,7 @@ function getLeafPaint(attrName: string, paint: IPaint, ui: IUI): ILeafPaint {
75
78
  leafPaint = PaintGradient.conicGradient(paint, boxBounds)
76
79
  break
77
80
  case 'solid':
78
- const { type, color, opacity } = paint
81
+ const { color, opacity } = paint
79
82
  leafPaint = { type, style: ColorConvert.string(color, opacity) }
80
83
  break
81
84
  default: