@leafer/display-module 2.0.1 → 2.0.3

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": "2.0.1",
3
+ "version": "2.0.3",
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": "2.0.1",
26
- "@leafer/event": "2.0.1",
27
- "@leafer/math": "2.0.1",
28
- "@leafer/data": "2.0.1",
29
- "@leafer/debug": "2.0.1"
25
+ "@leafer/helper": "2.0.3",
26
+ "@leafer/event": "2.0.3",
27
+ "@leafer/math": "2.0.3",
28
+ "@leafer/data": "2.0.3",
29
+ "@leafer/debug": "2.0.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "2.0.1"
32
+ "@leafer/interface": "2.0.3"
33
33
  }
34
34
  }
@@ -1,6 +1,6 @@
1
- import { ILeaferCanvas, IRenderOptions, IBranchRenderModule } from '@leafer/interface'
1
+ import { ILeaferCanvas, IRenderOptions, IBranchRenderModule, ILeaf } from '@leafer/interface'
2
2
  import { BoundsHelper } from '@leafer/math'
3
- import { LeafBoundsHelper } from '@leafer/helper'
3
+ import { LeafBoundsHelper, LeafHelper } from '@leafer/helper'
4
4
 
5
5
 
6
6
  const { excludeRenderBounds } = LeafBoundsHelper, { hasSize } = BoundsHelper
@@ -40,7 +40,7 @@ export const BranchRender: IBranchRenderModule = {
40
40
 
41
41
  this.__renderBranch(tempCanvas, options)
42
42
 
43
- canvas.opacity = options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity
43
+ canvas.opacity = options.ignoreOpacity ? 1 : (options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity)
44
44
  canvas.copyWorldByReset(tempCanvas, nowWorld, nowWorld, data.__blendMode, true)
45
45
 
46
46
  tempCanvas.recycle(nowWorld)
@@ -62,9 +62,11 @@ export const BranchRender: IBranchRenderModule = {
62
62
 
63
63
  } else {
64
64
 
65
+ let child: ILeaf
65
66
  const { children } = this
66
67
  for (let i = 0, len = children.length; i < len; i++) {
67
- excludeRenderBounds(children[i], options) || children[i].__render(canvas, options)
68
+ child = children[i]
69
+ excludeRenderBounds(child, options) || (child.__hasComplex ? LeafHelper.renderComplex(child, canvas, options) : child.__render(canvas, options))
68
70
  }
69
71
 
70
72
  }
package/src/LeafBounds.ts CHANGED
@@ -18,6 +18,8 @@ export const LeafBounds: ILeafBoundsModule = {
18
18
  const { __layout, __world } = this
19
19
  toOuterOf(__layout.renderBounds, __world, __world)
20
20
 
21
+ if (this.__hasComplex) LeafHelper.checkComplex(this) // 必须在重置resize之前执行
22
+
21
23
  if (__layout.resized) {
22
24
  if (__layout.resized === 'inner') this.__onUpdateSize() // scale变化不用更新
23
25
  if (this.__hasLocalEvent) BoundsEvent.emitLocal(this)
@@ -99,6 +101,8 @@ export const LeafBounds: ILeafBoundsModule = {
99
101
  if (this.parent) this.parent.__layout.renderChange()
100
102
  }
101
103
 
104
+ if (layout.outerScale) LeafHelper.updateOuterBounds(this)
105
+
102
106
  layout.resized || (layout.resized = 'local')
103
107
  layout.boundsChanged = undefined
104
108
 
package/src/LeafMatrix.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ILeafMatrixModule, ILayoutData } from '@leafer/interface'
2
2
  import { AroundHelper, MatrixHelper } from '@leafer/math'
3
+ import { LeafHelper } from '@leafer/helper'
3
4
 
4
5
 
5
6
  const { setLayout, multiplyParent, translateInner, defaultWorld } = MatrixHelper
@@ -13,6 +14,7 @@ export const LeafMatrix: ILeafMatrixModule = {
13
14
  multiplyParent(this.__local || __layout, parent ? (parent.__scrollWorld || parent.__world) : defaultWorld, __world, !!__layout.affectScaleOrRotation, __ as ILayoutData)
14
15
 
15
16
  if (__scrollWorld) translateInner(Object.assign(__scrollWorld, __world), __.scrollX, __.scrollY)
17
+ if (__layout.scaleFixed) LeafHelper.updateScaleFixedWorld(this)
16
18
  },
17
19
 
18
20
  __updateLocalMatrix(): void {
package/src/LeafRender.ts CHANGED
@@ -17,7 +17,7 @@ export const LeafRender: ILeafRenderModule = {
17
17
  if (data.bright && !options.topRendering) return options.topList.add(this)
18
18
 
19
19
  canvas.setWorld(this.__nowWorld = this.__getNowWorld(options))
20
- canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity
20
+ canvas.opacity = options.ignoreOpacity ? 1 : (options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity)
21
21
 
22
22
  if (this.__.__single) {
23
23