@leafer/layout 1.5.2 → 1.6.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/layout",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "@leafer/layout",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/math": "1.5.2",
26
- "@leafer/helper": "1.5.2",
27
- "@leafer/platform": "1.5.2"
25
+ "@leafer/math": "1.6.0",
26
+ "@leafer/helper": "1.6.0",
27
+ "@leafer/platform": "1.6.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.5.2"
30
+ "@leafer/interface": "1.6.0"
31
31
  }
32
32
  }
package/src/LeafLayout.ts CHANGED
@@ -22,6 +22,7 @@ export class LeafLayout implements ILeafLayout {
22
22
  public boxBounds: IBoundsData
23
23
  public get strokeBounds(): IBoundsData { return this._strokeBounds || this.boxBounds }
24
24
  public get renderBounds(): IBoundsData { return this._renderBounds || this.boxBounds }
25
+ public set renderBounds(bounds: IBoundsData) { this._renderBounds = bounds }
25
26
 
26
27
  public _contentBounds: IBoundsData
27
28
  public _strokeBounds: IBoundsData
@@ -102,10 +103,12 @@ export class LeafLayout implements ILeafLayout {
102
103
 
103
104
  constructor(leaf: ILeaf) {
104
105
  this.leaf = leaf
105
- this.boxBounds = { x: 0, y: 0, width: 0, height: 0 }
106
106
  if (this.leaf.__local) this._localRenderBounds = this._localStrokeBounds = this.leaf.__local
107
- this.boxChange()
108
- this.matrixChange()
107
+ if (leaf.__world) {
108
+ this.boxBounds = { x: 0, y: 0, width: 0, height: 0 }
109
+ this.boxChange()
110
+ this.matrixChange()
111
+ }
109
112
  }
110
113
 
111
114
  public createLocal(): void {
package/types/index.d.ts CHANGED
@@ -8,6 +8,7 @@ declare class LeafLayout implements ILeafLayout {
8
8
  boxBounds: IBoundsData;
9
9
  get strokeBounds(): IBoundsData;
10
10
  get renderBounds(): IBoundsData;
11
+ set renderBounds(bounds: IBoundsData);
11
12
  _contentBounds: IBoundsData;
12
13
  _strokeBounds: IBoundsData;
13
14
  _renderBounds: IBoundsData;