@leafer/display 1.0.0-rc.26 → 1.0.0-rc.28

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/display",
3
- "version": "1.0.0-rc.26",
3
+ "version": "1.0.0-rc.28",
4
4
  "description": "@leafer/display",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,16 +22,16 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/math": "1.0.0-rc.26",
26
- "@leafer/data": "1.0.0-rc.26",
27
- "@leafer/layout": "1.0.0-rc.26",
28
- "@leafer/display-module": "1.0.0-rc.26",
29
- "@leafer/event": "1.0.0-rc.26",
30
- "@leafer/decorator": "1.0.0-rc.26",
31
- "@leafer/helper": "1.0.0-rc.26",
32
- "@leafer/platform": "1.0.0-rc.26"
25
+ "@leafer/math": "1.0.0-rc.28",
26
+ "@leafer/data": "1.0.0-rc.28",
27
+ "@leafer/layout": "1.0.0-rc.28",
28
+ "@leafer/display-module": "1.0.0-rc.28",
29
+ "@leafer/event": "1.0.0-rc.28",
30
+ "@leafer/decorator": "1.0.0-rc.28",
31
+ "@leafer/helper": "1.0.0-rc.28",
32
+ "@leafer/platform": "1.0.0-rc.28"
33
33
  },
34
34
  "devDependencies": {
35
- "@leafer/interface": "1.0.0-rc.26"
35
+ "@leafer/interface": "1.0.0-rc.28"
36
36
  }
37
37
  }
package/src/Leaf.ts CHANGED
@@ -79,6 +79,7 @@ export class Leaf implements ILeaf {
79
79
 
80
80
  public get __onlyHitMask(): boolean { return this.__hasMask && !this.__.hitChildren }
81
81
  public get __ignoreHitWorld(): boolean { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren }
82
+ public get __inLazyBounds(): boolean { const { leafer } = this; return leafer && leafer.created && leafer.lazyBounds.hit(this.__world) }
82
83
 
83
84
  public get pathInputed(): boolean { return this.__.__pathInputed as unknown as boolean }
84
85
 
@@ -173,6 +174,11 @@ export class Leaf implements ILeaf {
173
174
  public set(_data: IObject): void { }
174
175
  public get(_name?: string): ILeafInputData | IValue { return undefined }
175
176
 
177
+ public setAttr(name: string, value: any): void { (this as IObject)[name] = value }
178
+ public getAttr(name: string): any { return (this as IObject)[name] }
179
+
180
+ public getComputedAttr(name: string): any { return (this.__ as IObject)[name] }
181
+
176
182
  public toJSON(): IObject {
177
183
  return this.__.__getInputData()
178
184
  }
@@ -219,6 +225,9 @@ export class Leaf implements ILeaf {
219
225
 
220
226
  // ---
221
227
 
228
+ public updateLayout(): void {
229
+ this.__layout.update()
230
+ }
222
231
 
223
232
  public forceUpdate(attrName?: string): void {
224
233
  if (attrName === undefined) attrName = 'width'
@@ -228,11 +237,10 @@ export class Leaf implements ILeaf {
228
237
  (this as any)[attrName] = value
229
238
  }
230
239
 
231
- public updateLayout(): void {
232
- this.__layout.update()
240
+ public forceRender(_bounds?: IBoundsData): void {
241
+ this.forceUpdate('surface')
233
242
  }
234
243
 
235
-
236
244
  // LeafMatrix rewrite
237
245
 
238
246
  public __updateWorldMatrix(): void { }
@@ -474,7 +482,7 @@ export class Leaf implements ILeaf {
474
482
  }
475
483
 
476
484
 
477
- // @leafer-ui/scale rewrite
485
+ // @leafer-in/resize rewrite
478
486
 
479
487
  public scaleResize(scaleX: number, scaleY = scaleX, _noResize?: boolean): void {
480
488
  (this as ILeaf).scaleX *= scaleX;
package/types/index.d.ts CHANGED
@@ -41,6 +41,7 @@ declare class Leaf implements ILeaf {
41
41
  __hitCanvas?: IHitCanvas;
42
42
  get __onlyHitMask(): boolean;
43
43
  get __ignoreHitWorld(): boolean;
44
+ get __inLazyBounds(): boolean;
44
45
  get pathInputed(): boolean;
45
46
  __captureMap?: IEventListenerMap;
46
47
  __bubbleMap?: IEventListenerMap;
@@ -59,6 +60,9 @@ declare class Leaf implements ILeaf {
59
60
  __bindLeafer(leafer: ILeaferBase | null): void;
60
61
  set(_data: IObject): void;
61
62
  get(_name?: string): ILeafInputData | IValue;
63
+ setAttr(name: string, value: any): void;
64
+ getAttr(name: string): any;
65
+ getComputedAttr(name: string): any;
62
66
  toJSON(): IObject;
63
67
  toString(): string;
64
68
  toSVG(): string;
@@ -73,8 +77,9 @@ declare class Leaf implements ILeaf {
73
77
  findOne(_condition: number | string | IFindMethod, _options?: any): ILeaf | undefined;
74
78
  findId(_id: number | string): ILeaf | undefined;
75
79
  focus(_value?: boolean): void;
76
- forceUpdate(attrName?: string): void;
77
80
  updateLayout(): void;
81
+ forceUpdate(attrName?: string): void;
82
+ forceRender(_bounds?: IBoundsData): void;
78
83
  __updateWorldMatrix(): void;
79
84
  __updateLocalMatrix(): void;
80
85
  __updateWorldBounds(): void;