@leafer/display-module 1.0.0-rc.4 → 1.0.0-rc.5
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 +4 -4
- package/src/LeafBounds.ts +1 -1
- package/src/LeafDataProxy.ts +3 -2
- package/src/LeafMatrix.ts +8 -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.5",
|
|
4
4
|
"description": "@leafer/display-module",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/event": "1.0.0-rc.
|
|
26
|
-
"@leafer/math": "1.0.0-rc.
|
|
25
|
+
"@leafer/event": "1.0.0-rc.5",
|
|
26
|
+
"@leafer/math": "1.0.0-rc.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-rc.
|
|
29
|
+
"@leafer/interface": "1.0.0-rc.5"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/LeafBounds.ts
CHANGED
|
@@ -124,7 +124,7 @@ export const LeafBounds: ILeafBoundsModule = {
|
|
|
124
124
|
data.__naturalHeight = layout.boxBounds.height
|
|
125
125
|
|
|
126
126
|
if (this.around) {
|
|
127
|
-
layout.
|
|
127
|
+
layout.matrixChanged = true
|
|
128
128
|
this.__updateWorldMatrix()
|
|
129
129
|
}
|
|
130
130
|
},
|
package/src/LeafDataProxy.ts
CHANGED
|
@@ -6,10 +6,11 @@ export const LeafDataProxy: ILeafDataProxyModule = {
|
|
|
6
6
|
|
|
7
7
|
__setAttr(name: string, newValue: unknown): void {
|
|
8
8
|
if (this.leafer && this.leafer.created) {
|
|
9
|
-
|
|
9
|
+
const oldValue = this.__.__getInput(name)
|
|
10
|
+
if (typeof newValue === 'object' || oldValue !== newValue) {
|
|
10
11
|
this.__[name] = newValue
|
|
11
12
|
const { CHANGE } = PropertyEvent
|
|
12
|
-
const event = new PropertyEvent(CHANGE, this, name,
|
|
13
|
+
const event = new PropertyEvent(CHANGE, this, name, oldValue, newValue)
|
|
13
14
|
if (this.hasEvent(CHANGE) && !this.isLeafer) this.emitEvent(event)
|
|
14
15
|
this.leafer.emitEvent(event)
|
|
15
16
|
}
|
package/src/LeafMatrix.ts
CHANGED
|
@@ -101,17 +101,19 @@ export const LeafMatrix: ILeafMatrixModule = {
|
|
|
101
101
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
const { x, y, around } = this.__
|
|
105
|
+
|
|
106
|
+
r.e = x
|
|
107
|
+
r.f = y
|
|
108
|
+
|
|
109
|
+
if (around) {
|
|
110
|
+
const { width, height } = this.__
|
|
111
|
+
if (width && height) {
|
|
109
112
|
const origin = (around === 'center') ? defaultCenter : around
|
|
110
113
|
const offsetX = width * origin.x, offsetY = height * origin.y
|
|
111
114
|
r.e -= offsetX * r.a + offsetY * r.c
|
|
112
115
|
r.f -= offsetX * r.b + offsetY * r.d
|
|
113
116
|
}
|
|
114
|
-
layout.positionChanged = false
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
this.__layout.matrixChanged = false
|