@leafer/display-module 1.0.0-rc.11 → 1.0.0-rc.16
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 +5 -5
- package/src/LeafBounds.ts +12 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/display-module",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.16",
|
|
4
4
|
"description": "@leafer/display-module",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/helper": "1.0.0-rc.
|
|
26
|
-
"@leafer/event": "1.0.0-rc.
|
|
27
|
-
"@leafer/math": "1.0.0-rc.
|
|
25
|
+
"@leafer/helper": "1.0.0-rc.16",
|
|
26
|
+
"@leafer/event": "1.0.0-rc.16",
|
|
27
|
+
"@leafer/math": "1.0.0-rc.16"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@leafer/interface": "1.0.0-rc.
|
|
30
|
+
"@leafer/interface": "1.0.0-rc.16"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/LeafBounds.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ILeafBoundsModule } from '@leafer/interface'
|
|
2
2
|
import { BoundsHelper } from '@leafer/math'
|
|
3
|
+
import { PathBounds } from '@leafer/path'
|
|
3
4
|
import { BranchHelper, LeafHelper } from '@leafer/helper'
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
const { updateMatrix, updateAllMatrix, hasParentAutoLayout } = LeafHelper
|
|
7
8
|
const { updateBounds } = BranchHelper
|
|
8
9
|
const { toOuterOf, copyAndSpread } = BoundsHelper
|
|
10
|
+
const { toBounds } = PathBounds
|
|
9
11
|
|
|
10
12
|
export const LeafBounds: ILeafBoundsModule = {
|
|
11
13
|
|
|
@@ -26,7 +28,7 @@ export const LeafBounds: ILeafBoundsModule = {
|
|
|
26
28
|
|
|
27
29
|
if (layout.boxChanged) {
|
|
28
30
|
|
|
29
|
-
this.__updatePath()
|
|
31
|
+
if (!this.__.__pathInputed) this.__updatePath()
|
|
30
32
|
this.__updateRenderPath()
|
|
31
33
|
|
|
32
34
|
this.__updateBoxBounds()
|
|
@@ -113,11 +115,15 @@ export const LeafBounds: ILeafBoundsModule = {
|
|
|
113
115
|
|
|
114
116
|
__updateBoxBounds(): void {
|
|
115
117
|
const b = this.__layout.boxBounds
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
const data = this.__
|
|
119
|
+
if (data.__pathInputed) {
|
|
120
|
+
toBounds(data.__pathForRender, b)
|
|
121
|
+
} else {
|
|
122
|
+
b.x = 0
|
|
123
|
+
b.y = 0
|
|
124
|
+
b.width = data.width
|
|
125
|
+
b.height = data.height
|
|
126
|
+
}
|
|
121
127
|
},
|
|
122
128
|
|
|
123
129
|
|