@leafer/helper 1.6.1 → 1.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/helper",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "@leafer/helper",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,9 +22,9 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/math": "1.6.1"
25
+ "@leafer/math": "1.6.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.6.1"
28
+ "@leafer/interface": "1.6.2"
29
29
  }
30
30
  }
package/src/LeafHelper.ts CHANGED
@@ -53,11 +53,15 @@ export const LeafHelper = {
53
53
  }
54
54
  },
55
55
 
56
- updateAllChange(leaf: ILeaf): void {
57
- updateAllWorldOpacity(leaf)
58
-
56
+ updateChange(leaf: ILeaf): void {
57
+ const layout = leaf.__layout
58
+ if (layout.stateStyleChanged) leaf.updateState()
59
+ if (layout.opacityChanged) updateAllWorldOpacity(leaf)
59
60
  leaf.__updateChange()
61
+ },
60
62
 
63
+ updateAllChange(leaf: ILeaf): void {
64
+ updateChange(leaf)
61
65
  if (leaf.isBranch) {
62
66
  const { children } = leaf
63
67
  for (let i = 0, len = children.length; i < len; i++) {
@@ -204,7 +208,7 @@ export const LeafHelper = {
204
208
  }
205
209
 
206
210
  const L = LeafHelper
207
- const { updateAllMatrix, updateMatrix, updateAllWorldOpacity, updateAllChange } = L
211
+ const { updateAllMatrix, updateMatrix, updateAllWorldOpacity, updateAllChange, updateChange } = L
208
212
 
209
213
  function getTempLocal(t: ILeaf, world: IPointData): IPointData {
210
214
  t.__layout.update()
package/types/index.d.ts CHANGED
@@ -5,6 +5,7 @@ declare const LeafHelper: {
5
5
  updateMatrix(leaf: ILeaf, checkAutoLayout?: boolean, waitAutoLayout?: boolean): void;
6
6
  updateBounds(leaf: ILeaf): void;
7
7
  updateAllWorldOpacity(leaf: ILeaf): void;
8
+ updateChange(leaf: ILeaf): void;
8
9
  updateAllChange(leaf: ILeaf): void;
9
10
  worldHittable(t: ILeaf): boolean;
10
11
  moveWorld(t: ILeaf, x: number | IPointData, y?: number, isInnerPoint?: boolean, transition?: ITransition): void;