@leafer-ui/render 1.4.0 → 1.4.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 +4 -4
  2. package/src/UIRender.ts +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/render",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "@leafer-ui/render",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer-ui/external": "1.4.0"
25
+ "@leafer-ui/external": "1.4.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.4.0",
29
- "@leafer-ui/interface": "1.4.0"
28
+ "@leafer/interface": "1.4.2",
29
+ "@leafer-ui/interface": "1.4.2"
30
30
  }
31
31
  }
package/src/UIRender.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ILeaferCanvas, IRenderOptions } from '@leafer/interface'
2
2
 
3
3
  import { IUIRenderModule, ILeafPaint, ILeafStrokePaint, IUI } from '@leafer-ui/interface'
4
- import { Paint, Effect } from '@leafer-ui/external'
4
+ import { Paint, Effect, Filter } from '@leafer-ui/external'
5
5
 
6
6
 
7
7
  export const UIRender: IUIRenderModule = {
@@ -10,8 +10,8 @@ export const UIRender: IUIRenderModule = {
10
10
  const data = this.__
11
11
 
12
12
  if (data.__useEffect) {
13
- const { shadow, innerShadow, blur, backgroundBlur } = this.__
14
- data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur)
13
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__
14
+ data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter)
15
15
  }
16
16
 
17
17
  data.__checkSingle()
@@ -29,7 +29,7 @@ export const UIRender: IUIRenderModule = {
29
29
  drawFast(this, canvas, options)
30
30
  },
31
31
 
32
- __draw(canvas: ILeaferCanvas, options: IRenderOptions): void {
32
+ __draw(canvas: ILeaferCanvas, options: IRenderOptions, originCanvas?: ILeaferCanvas): void {
33
33
  const data = this.__
34
34
 
35
35
  if (data.__complex) {
@@ -45,7 +45,7 @@ export const UIRender: IUIRenderModule = {
45
45
  const shape = Paint.shape(this, canvas, options)
46
46
  this.__nowWorld = this.__getNowWorld(options) // restore
47
47
 
48
- const { shadow, innerShadow } = data
48
+ const { shadow, innerShadow, filter } = data
49
49
 
50
50
  if (shadow) Effect.shadow(this, canvas, shape)
51
51
 
@@ -57,6 +57,8 @@ export const UIRender: IUIRenderModule = {
57
57
 
58
58
  if (stroke) data.__isStrokes ? Paint.strokes(stroke as ILeafStrokePaint[], this, canvas) : Paint.stroke(stroke as string, this, canvas)
59
59
 
60
+ if (filter) Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape)
61
+
60
62
  if (shape.worldCanvas) shape.worldCanvas.recycle()
61
63
  shape.canvas.recycle()
62
64