@leafer/layout 1.0.0-alpha.1 → 1.0.0-alpha.10

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.
Files changed (2) hide show
  1. package/package.json +7 -5
  2. package/src/LeafLayout.ts +10 -9
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@leafer/layout",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.10",
4
4
  "description": "@leafer/layout",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
7
7
  "main": "src/index.ts",
8
- "files": ["src"],
8
+ "files": [
9
+ "src"
10
+ ],
9
11
  "repository": {
10
12
  "type": "git",
11
13
  "url": "https://github.com/leaferjs/leafer.git"
@@ -17,9 +19,9 @@
17
19
  "leaferjs"
18
20
  ],
19
21
  "dependencies": {
20
- "@leafer/math": "1.0.0-alpha.1"
22
+ "@leafer/math": "1.0.0-alpha.10"
21
23
  },
22
24
  "devDependencies": {
23
- "@leafer/interface": "1.0.0-alpha.1"
25
+ "@leafer/interface": "1.0.0-alpha.10"
24
26
  }
25
- }
27
+ }
package/src/LeafLayout.ts CHANGED
@@ -68,6 +68,7 @@ export class LeafLayout implements ILeafLayout {
68
68
  this.leaf = leaf
69
69
  this.renderBounds = this.eventBounds = this.boxBounds = { x: 0, y: 0, width: 0, height: 0 }
70
70
  this.relativeRenderBounds = this.relativeEventBounds = leaf.__relative
71
+ this.boxBoundsChange()
71
72
  }
72
73
 
73
74
 
@@ -169,24 +170,24 @@ export class LeafLayout implements ILeafLayout {
169
170
  public boxBoundsChange(): void {
170
171
  this.boxBoundsChanged = true
171
172
  this.localBoxBoundsChanged || this.localBoxBoundsChange()
172
- this.hitCanvasChanged || (this.hitCanvasChanged = true)
173
+ this.hitCanvasChanged = true
173
174
  }
174
175
 
175
176
  public localBoxBoundsChange(): void {
176
177
  this.localBoxBoundsChanged = true
177
- this.boundsChanged || (this.boundsChanged = true)
178
+ this.boundsChanged = true
178
179
  }
179
180
 
180
181
  public eventBoundsChange(): void {
181
182
  this.eventBoundsChanged = true
182
183
  this.eventBoundsSpreadWidth || (this.eventBoundsSpreadWidth = 1)
183
- this.boundsChanged || (this.boundsChanged = true)
184
+ this.boundsChanged = true
184
185
  }
185
186
 
186
187
  public renderBoundsChange(): void {
187
188
  this.renderBoundsChanged = true
188
189
  this.renderBoundsSpreadWidth || (this.renderBoundsSpreadWidth = 1)
189
- this.boundsChanged || (this.boundsChanged = true)
190
+ this.boundsChanged = true
190
191
  }
191
192
 
192
193
 
@@ -194,7 +195,7 @@ export class LeafLayout implements ILeafLayout {
194
195
 
195
196
  public positionChange(): void {
196
197
  this.positionChanged = true
197
- this.matrixChanged || (this.matrixChanged = true)
198
+ this.matrixChanged = true
198
199
  this.localBoxBoundsChanged || this.localBoxBoundsChange()
199
200
  }
200
201
 
@@ -205,13 +206,13 @@ export class LeafLayout implements ILeafLayout {
205
206
 
206
207
  public rotationChange(): void {
207
208
  this.rotationChanged = true
208
- this.affectRotation || (this.affectRotation = true)
209
+ this.affectRotation = true
209
210
  this._scaleOrRotationChange()
210
211
  }
211
212
 
212
213
  protected _scaleOrRotationChange() {
213
- this.affectScaleOrRotation || (this.affectScaleOrRotation = true)
214
- this.matrixChanged || (this.matrixChanged = true)
214
+ this.affectScaleOrRotation = true
215
+ this.matrixChanged = true
215
216
  this.localBoxBoundsChanged || this.localBoxBoundsChange()
216
217
  }
217
218
 
@@ -228,7 +229,7 @@ export class LeafLayout implements ILeafLayout {
228
229
  }
229
230
 
230
231
  public destroy(): void {
231
- this.leaf = undefined
232
+ this.leaf = null
232
233
  }
233
234
 
234
235
  }