@leafer-ui/render 1.0.0-alpha.30 → 1.0.0-alpha.31

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 +4 -4
  2. package/src/UIRender.ts +23 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/render",
3
- "version": "1.0.0-alpha.30",
3
+ "version": "1.0.0-alpha.31",
4
4
  "description": "@leafer-ui/render",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,10 +19,10 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer-ui/external": "1.0.0-alpha.30"
22
+ "@leafer-ui/external": "1.0.0-alpha.31"
23
23
  },
24
24
  "devDependencies": {
25
- "@leafer/interface": "1.0.0-alpha.30",
26
- "@leafer-ui/interface": "1.0.0-alpha.30"
25
+ "@leafer/interface": "1.0.0-alpha.31",
26
+ "@leafer-ui/interface": "1.0.0-alpha.31"
27
27
  }
28
28
  }
package/src/UIRender.ts CHANGED
@@ -8,7 +8,13 @@ export const UIRender: IUIRenderModule = {
8
8
 
9
9
  __updateChange(): void {
10
10
  let data = this.__
11
- let complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect
11
+
12
+ if (data.__useEffect) {
13
+ const { shadow, innerShadow, blur, backgroundBlur } = this.__
14
+ data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur)
15
+ }
16
+
17
+ let complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect || data.blendMode !== 'pass-through'
12
18
 
13
19
  if (complex) {
14
20
  data.__complex = true
@@ -27,9 +33,17 @@ export const UIRender: IUIRenderModule = {
27
33
  },
28
34
 
29
35
  __draw(canvas: ILeaferCanvas, options: IRenderOptions): void {
36
+
30
37
  if (this.__.__complex) {
31
38
 
32
- const { fill, stroke, __drawAfterFill, __font } = this.__
39
+ const { fill, stroke, __drawAfterFill, __font, __blendLayer } = this.__
40
+
41
+ let orginCanvas: ILeaferCanvas
42
+
43
+ if (__blendLayer) {
44
+ orginCanvas = canvas
45
+ canvas = canvas.getSameCanvas(true)
46
+ }
33
47
 
34
48
  __font ? canvas.font = __font : this.__drawRenderPath(canvas)
35
49
 
@@ -53,9 +67,16 @@ export const UIRender: IUIRenderModule = {
53
67
  shape.canvas.recycle()
54
68
 
55
69
  } else {
70
+
56
71
  if (fill) this.__.__isFills ? Paint.fills(this, canvas, fill as ILeafPaint[]) : Paint.fill(this, canvas, fill)
57
72
  if (__drawAfterFill) this.__drawAfterFill(canvas, options)
58
73
  if (stroke) this.__.__isStrokes ? Paint.strokes(this, canvas, stroke as ILeafStrokePaint[]) : Paint.stroke(this, canvas, stroke)
74
+
75
+ }
76
+
77
+ if (orginCanvas) {
78
+ orginCanvas.copyWorldToInner(canvas, this.__world, this.__layout.renderBounds, this.__.blendMode)
79
+ canvas.recycle()
59
80
  }
60
81
 
61
82