@leafer/display-module 1.12.3 → 2.0.0

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/display-module",
3
- "version": "1.12.3",
3
+ "version": "2.0.0",
4
4
  "description": "@leafer/display-module",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,13 +22,13 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/helper": "1.12.3",
26
- "@leafer/event": "1.12.3",
27
- "@leafer/math": "1.12.3",
28
- "@leafer/data": "1.12.3",
29
- "@leafer/debug": "1.12.3"
25
+ "@leafer/helper": "2.0.0",
26
+ "@leafer/event": "2.0.0",
27
+ "@leafer/math": "2.0.0",
28
+ "@leafer/data": "2.0.0",
29
+ "@leafer/debug": "2.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "1.12.3"
32
+ "@leafer/interface": "2.0.0"
33
33
  }
34
34
  }
@@ -1,8 +1,9 @@
1
- import { LeafBoundsHelper } from '@leafer/helper'
2
1
  import { ILeaferCanvas, IRenderOptions, IBranchRenderModule } from '@leafer/interface'
2
+ import { BoundsHelper } from '@leafer/math'
3
+ import { LeafBoundsHelper } from '@leafer/helper'
3
4
 
4
5
 
5
- const { excludeRenderBounds } = LeafBoundsHelper
6
+ const { excludeRenderBounds } = LeafBoundsHelper, { hasSize } = BoundsHelper
6
7
 
7
8
  export const BranchRender: IBranchRenderModule = {
8
9
 
@@ -19,9 +20,9 @@ export const BranchRender: IBranchRenderModule = {
19
20
 
20
21
  __render(canvas: ILeaferCanvas, options: IRenderOptions): void {
21
22
 
22
- this.__nowWorld = this.__getNowWorld(options)
23
+ const nowWorld = this.__nowWorld = this.__getNowWorld(options)
23
24
 
24
- if (this.__worldOpacity) {
25
+ if (this.__worldOpacity && hasSize(nowWorld)) { // 无宽高时渲染 mask 会有问题
25
26
 
26
27
  const data = this.__
27
28
 
@@ -39,8 +40,6 @@ export const BranchRender: IBranchRenderModule = {
39
40
 
40
41
  this.__renderBranch(tempCanvas, options)
41
42
 
42
- const nowWorld = this.__nowWorld
43
-
44
43
  canvas.opacity = options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity
45
44
  canvas.copyWorldByReset(tempCanvas, nowWorld, nowWorld, data.__blendMode, true)
46
45