@leafer/display 1.0.0-alpha.2 → 1.0.0-alpha.21
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 +9 -9
- package/src/Branch.ts +4 -4
- package/src/Leaf.ts +14 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/display",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.21",
|
|
4
4
|
"description": "@leafer/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"leaferjs"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@leafer/math": "1.0.0-alpha.
|
|
23
|
-
"@leafer/data": "1.0.0-alpha.
|
|
24
|
-
"@leafer/layout": "1.0.0-alpha.
|
|
25
|
-
"@leafer/display-module": "1.0.0-alpha.
|
|
26
|
-
"@leafer/event": "1.0.0-alpha.
|
|
27
|
-
"@leafer/decorator": "1.0.0-alpha.
|
|
28
|
-
"@leafer/helper": "1.0.0-alpha.
|
|
22
|
+
"@leafer/math": "1.0.0-alpha.21",
|
|
23
|
+
"@leafer/data": "1.0.0-alpha.21",
|
|
24
|
+
"@leafer/layout": "1.0.0-alpha.21",
|
|
25
|
+
"@leafer/display-module": "1.0.0-alpha.21",
|
|
26
|
+
"@leafer/event": "1.0.0-alpha.21",
|
|
27
|
+
"@leafer/decorator": "1.0.0-alpha.21",
|
|
28
|
+
"@leafer/helper": "1.0.0-alpha.21"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@leafer/interface": "1.0.0-alpha.
|
|
31
|
+
"@leafer/interface": "1.0.0-alpha.21"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/Branch.ts
CHANGED
|
@@ -95,7 +95,7 @@ export class Branch extends Leaf {
|
|
|
95
95
|
child.parent = this
|
|
96
96
|
|
|
97
97
|
index === undefined ? this.children.push(child) : this.children.splice(index, 0, child)
|
|
98
|
-
if (child.__isBranch) this.__childBranchNumber ? this.__childBranchNumber++ : this.__childBranchNumber = 1
|
|
98
|
+
if (child.__isBranch) this.__.__childBranchNumber ? this.__.__childBranchNumber++ : this.__.__childBranchNumber = 1
|
|
99
99
|
|
|
100
100
|
if (this.root) {
|
|
101
101
|
child.__bindRoot(this.root)
|
|
@@ -115,16 +115,16 @@ export class Branch extends Leaf {
|
|
|
115
115
|
if (index > -1) {
|
|
116
116
|
this.children.splice(index, 1)
|
|
117
117
|
|
|
118
|
-
if (child.__isBranch) this.__childBranchNumber > 1 ? this.__childBranchNumber-- : this.__childBranchNumber = 0
|
|
118
|
+
if (child.__isBranch) this.__.__childBranchNumber > 1 ? this.__.__childBranchNumber-- : this.__.__childBranchNumber = 0
|
|
119
119
|
|
|
120
120
|
if (this.root) {
|
|
121
121
|
const event = new ChildEvent(ChildEvent.REMOVE, child, this)
|
|
122
122
|
if (this.hasEvent(ChildEvent.REMOVE)) this.emitEvent(event)
|
|
123
123
|
this.root.emitEvent(event)
|
|
124
|
-
child.root =
|
|
124
|
+
child.root = null
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
child.parent =
|
|
127
|
+
child.parent = null
|
|
128
128
|
this.__layout.boxBoundsChange()
|
|
129
129
|
}
|
|
130
130
|
} else {
|
package/src/Leaf.ts
CHANGED
|
@@ -37,10 +37,6 @@ export class Leaf implements ILeaf {
|
|
|
37
37
|
|
|
38
38
|
public __worldOpacity: number
|
|
39
39
|
public __renderTime: number // μs 1000微秒 = 1毫秒
|
|
40
|
-
public __complex: boolean // 外观是否复杂
|
|
41
|
-
|
|
42
|
-
public __interactionOff: boolean
|
|
43
|
-
public __childrenInteractionOff: boolean
|
|
44
40
|
|
|
45
41
|
public __level: number // 所在层级 0 -> 高
|
|
46
42
|
public __tempNumber: number // 用于排序,记录最后一次在parent中的排序索引,可用于移除之后回退
|
|
@@ -56,7 +52,6 @@ export class Leaf implements ILeaf {
|
|
|
56
52
|
|
|
57
53
|
// branch
|
|
58
54
|
public children?: ILeaf[]
|
|
59
|
-
public __childBranchNumber?: number
|
|
60
55
|
|
|
61
56
|
constructor(data?: ILeafInputData) {
|
|
62
57
|
|
|
@@ -84,7 +79,7 @@ export class Leaf implements ILeaf {
|
|
|
84
79
|
for (let i = 0; i < len; i++) {
|
|
85
80
|
this.__parentWait[i]()
|
|
86
81
|
}
|
|
87
|
-
this.__parentWait =
|
|
82
|
+
this.__parentWait = null
|
|
88
83
|
}
|
|
89
84
|
|
|
90
85
|
public __setAsLeafer(): void {
|
|
@@ -123,14 +118,6 @@ export class Leaf implements ILeaf {
|
|
|
123
118
|
// ---
|
|
124
119
|
|
|
125
120
|
|
|
126
|
-
// worldOpacity rewrite, include visible
|
|
127
|
-
|
|
128
|
-
public __updateWorldOpacity(): void { }
|
|
129
|
-
|
|
130
|
-
// ---
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
121
|
// LeafMatrix rewrite
|
|
135
122
|
|
|
136
123
|
public __updateWorldMatrix(): void { }
|
|
@@ -189,6 +176,10 @@ export class Leaf implements ILeaf {
|
|
|
189
176
|
|
|
190
177
|
public __draw(_canvas: ILeaferCanvas, _options: IRenderOptions): void { }
|
|
191
178
|
|
|
179
|
+
public __updateWorldOpacity(): void { }
|
|
180
|
+
|
|
181
|
+
public __updateRenderTime(): void { }
|
|
182
|
+
|
|
192
183
|
public __updateChange(): void { }
|
|
193
184
|
|
|
194
185
|
// ---
|
|
@@ -241,25 +232,25 @@ export class Leaf implements ILeaf {
|
|
|
241
232
|
|
|
242
233
|
if (this.__isBranch) {
|
|
243
234
|
this.children.forEach(child => { child.destroy() })
|
|
244
|
-
this.children =
|
|
235
|
+
this.children = null
|
|
245
236
|
}
|
|
246
237
|
|
|
247
238
|
if (this.__hitCanvas) {
|
|
248
239
|
this.__hitCanvas.destroy()
|
|
249
|
-
this.__hitCanvas =
|
|
240
|
+
this.__hitCanvas = null
|
|
250
241
|
}
|
|
251
242
|
|
|
252
|
-
this.leafer =
|
|
253
|
-
this.root =
|
|
254
|
-
this.parent =
|
|
243
|
+
this.leafer = null
|
|
244
|
+
this.root = null
|
|
245
|
+
this.parent = null
|
|
255
246
|
|
|
256
247
|
this.__.destroy()
|
|
257
248
|
this.__layout.destroy()
|
|
258
|
-
this.__ =
|
|
259
|
-
this.__layout =
|
|
249
|
+
this.__ = null
|
|
250
|
+
this.__layout = null
|
|
260
251
|
|
|
261
|
-
this.__captureMap =
|
|
262
|
-
this.__bubbleMap =
|
|
252
|
+
this.__captureMap = null
|
|
253
|
+
this.__bubbleMap = null
|
|
263
254
|
}
|
|
264
255
|
}
|
|
265
256
|
|