@leafer/display 1.9.1 → 1.9.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 +12 -12
- package/src/Branch.ts +7 -7
- package/src/Leaf.ts +8 -4
- package/types/index.d.ts +9 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/display",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "@leafer/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/math": "1.9.
|
|
26
|
-
"@leafer/data": "1.9.
|
|
27
|
-
"@leafer/layout": "1.9.
|
|
28
|
-
"@leafer/display-module": "1.9.
|
|
29
|
-
"@leafer/event": "1.9.
|
|
30
|
-
"@leafer/decorator": "1.9.
|
|
31
|
-
"@leafer/helper": "1.9.
|
|
32
|
-
"@leafer/image": "1.9.
|
|
33
|
-
"@leafer/debug": "1.9.
|
|
34
|
-
"@leafer/platform": "1.9.
|
|
25
|
+
"@leafer/math": "1.9.2",
|
|
26
|
+
"@leafer/data": "1.9.2",
|
|
27
|
+
"@leafer/layout": "1.9.2",
|
|
28
|
+
"@leafer/display-module": "1.9.2",
|
|
29
|
+
"@leafer/event": "1.9.2",
|
|
30
|
+
"@leafer/decorator": "1.9.2",
|
|
31
|
+
"@leafer/helper": "1.9.2",
|
|
32
|
+
"@leafer/image": "1.9.2",
|
|
33
|
+
"@leafer/debug": "1.9.2",
|
|
34
|
+
"@leafer/platform": "1.9.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@leafer/interface": "1.9.
|
|
37
|
+
"@leafer/interface": "1.9.2"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/src/Branch.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaf } from '@leafer/interface'
|
|
1
|
+
import { IBoundsData, ILeaf } from '@leafer/interface'
|
|
2
2
|
import { ChildEvent } from '@leafer/event'
|
|
3
3
|
import { BoundsHelper } from '@leafer/math'
|
|
4
4
|
import { BranchHelper, LeafBoundsHelper } from '@leafer/helper'
|
|
@@ -37,16 +37,16 @@ export class Branch extends Leaf { // tip: rewrited Group
|
|
|
37
37
|
return 0
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
public __updateBoxBounds(): void {
|
|
41
|
-
setListWithFn(this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds)
|
|
40
|
+
public __updateBoxBounds(_secondLayout?: boolean, bounds?: IBoundsData): void {
|
|
41
|
+
setListWithFn(bounds || this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
public __updateStrokeBounds(): void {
|
|
45
|
-
setListWithFn(this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds)
|
|
44
|
+
public __updateStrokeBounds(bounds?: IBoundsData): void {
|
|
45
|
+
setListWithFn(bounds || this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
public __updateRenderBounds(): void {
|
|
49
|
-
setListWithFn(this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds)
|
|
48
|
+
public __updateRenderBounds(bounds?: IBoundsData): void {
|
|
49
|
+
setListWithFn(bounds || this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
|
package/src/Leaf.ts
CHANGED
|
@@ -66,6 +66,9 @@ export class Leaf implements ILeaf {
|
|
|
66
66
|
public get worldTransform(): IMatrixWithScaleData { return this.__layout.getTransform('world') as IMatrixWithScaleData }
|
|
67
67
|
public get localTransform(): IMatrixData { return this.__layout.getTransform('local') }
|
|
68
68
|
|
|
69
|
+
public __scrollWorld?: IMatrixWithBoundsScaleData
|
|
70
|
+
public get scrollWorldTransform(): IMatrixWithScaleData { this.updateLayout(); return this.__scrollWorld || this.__world }
|
|
71
|
+
|
|
69
72
|
// now bounds
|
|
70
73
|
public get boxBounds(): IBoundsData { return this.getBounds('box', 'inner') }
|
|
71
74
|
public get renderBounds(): IBoundsData { return this.getBounds('render', 'inner') }
|
|
@@ -74,7 +77,7 @@ export class Leaf implements ILeaf {
|
|
|
74
77
|
public get worldRenderBounds(): IBoundsData { return this.getBounds('render') }
|
|
75
78
|
|
|
76
79
|
// now opacity
|
|
77
|
-
public get worldOpacity(): number { this.
|
|
80
|
+
public get worldOpacity(): number { this.updateLayout(); return this.__worldOpacity }
|
|
78
81
|
|
|
79
82
|
public __level: number // layer level 0 -> branch -> branch -> deep
|
|
80
83
|
public __tempNumber: number // temp sort
|
|
@@ -103,6 +106,7 @@ export class Leaf implements ILeaf {
|
|
|
103
106
|
|
|
104
107
|
// branch
|
|
105
108
|
public children?: ILeaf[]
|
|
109
|
+
public topChildren?: ILeaf[]
|
|
106
110
|
|
|
107
111
|
public destroyed: boolean
|
|
108
112
|
|
|
@@ -285,13 +289,13 @@ export class Leaf implements ILeaf {
|
|
|
285
289
|
|
|
286
290
|
// box
|
|
287
291
|
|
|
288
|
-
public __updateBoxBounds(): void { }
|
|
292
|
+
public __updateBoxBounds(_secondLayout?: boolean, _bounds?: IBoundsData): void { }
|
|
289
293
|
|
|
290
294
|
public __updateContentBounds(): void { }
|
|
291
295
|
|
|
292
|
-
public __updateStrokeBounds(): void { }
|
|
296
|
+
public __updateStrokeBounds(_bounds?: IBoundsData): void { }
|
|
293
297
|
|
|
294
|
-
public __updateRenderBounds(): void { }
|
|
298
|
+
public __updateRenderBounds(_bounds?: IBoundsData): void { }
|
|
295
299
|
|
|
296
300
|
|
|
297
301
|
public __updateAutoLayout(): void { }
|
package/types/index.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ declare class Leaf implements ILeaf {
|
|
|
30
30
|
__worldOpacity: number;
|
|
31
31
|
get worldTransform(): IMatrixWithScaleData;
|
|
32
32
|
get localTransform(): IMatrixData;
|
|
33
|
+
__scrollWorld?: IMatrixWithBoundsScaleData;
|
|
34
|
+
get scrollWorldTransform(): IMatrixWithScaleData;
|
|
33
35
|
get boxBounds(): IBoundsData;
|
|
34
36
|
get renderBounds(): IBoundsData;
|
|
35
37
|
get worldBoxBounds(): IBoundsData;
|
|
@@ -53,6 +55,7 @@ declare class Leaf implements ILeaf {
|
|
|
53
55
|
__hasLocalEvent?: boolean;
|
|
54
56
|
__hasWorldEvent?: boolean;
|
|
55
57
|
children?: ILeaf[];
|
|
58
|
+
topChildren?: ILeaf[];
|
|
56
59
|
destroyed: boolean;
|
|
57
60
|
constructor(data?: ILeafInputData);
|
|
58
61
|
reset(data?: ILeafInputData): void;
|
|
@@ -93,10 +96,10 @@ declare class Leaf implements ILeaf {
|
|
|
93
96
|
__updateLocalBoxBounds(): void;
|
|
94
97
|
__updateLocalStrokeBounds(): void;
|
|
95
98
|
__updateLocalRenderBounds(): void;
|
|
96
|
-
__updateBoxBounds(): void;
|
|
99
|
+
__updateBoxBounds(_secondLayout?: boolean, _bounds?: IBoundsData): void;
|
|
97
100
|
__updateContentBounds(): void;
|
|
98
|
-
__updateStrokeBounds(): void;
|
|
99
|
-
__updateRenderBounds(): void;
|
|
101
|
+
__updateStrokeBounds(_bounds?: IBoundsData): void;
|
|
102
|
+
__updateRenderBounds(_bounds?: IBoundsData): void;
|
|
100
103
|
__updateAutoLayout(): void;
|
|
101
104
|
__updateFlowLayout(): void;
|
|
102
105
|
__updateNaturalSize(): void;
|
|
@@ -194,9 +197,9 @@ declare class Leaf implements ILeaf {
|
|
|
194
197
|
declare class Branch extends Leaf {
|
|
195
198
|
__updateStrokeSpread(): number;
|
|
196
199
|
__updateRenderSpread(): number;
|
|
197
|
-
__updateBoxBounds(): void;
|
|
198
|
-
__updateStrokeBounds(): void;
|
|
199
|
-
__updateRenderBounds(): void;
|
|
200
|
+
__updateBoxBounds(_secondLayout?: boolean, bounds?: IBoundsData): void;
|
|
201
|
+
__updateStrokeBounds(bounds?: IBoundsData): void;
|
|
202
|
+
__updateRenderBounds(bounds?: IBoundsData): void;
|
|
200
203
|
__updateSortChildren(): void;
|
|
201
204
|
add(child: ILeaf, index?: number): void;
|
|
202
205
|
addMany(...children: ILeaf[]): void;
|