@leafer/display 1.5.3 → 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/display",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "description": "@leafer/display",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,17 +22,17 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/math": "1.5.3",
26
- "@leafer/data": "1.5.3",
27
- "@leafer/layout": "1.5.3",
28
- "@leafer/display-module": "1.5.3",
29
- "@leafer/event": "1.5.3",
30
- "@leafer/decorator": "1.5.3",
31
- "@leafer/helper": "1.5.3",
32
- "@leafer/debug": "1.5.3",
33
- "@leafer/platform": "1.5.3"
25
+ "@leafer/math": "1.6.0",
26
+ "@leafer/data": "1.6.0",
27
+ "@leafer/layout": "1.6.0",
28
+ "@leafer/display-module": "1.6.0",
29
+ "@leafer/event": "1.6.0",
30
+ "@leafer/decorator": "1.6.0",
31
+ "@leafer/helper": "1.6.0",
32
+ "@leafer/debug": "1.6.0",
33
+ "@leafer/platform": "1.6.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@leafer/interface": "1.5.3"
36
+ "@leafer/interface": "1.6.0"
37
37
  }
38
38
  }
package/src/Leaf.ts CHANGED
@@ -99,9 +99,6 @@ export class Leaf implements ILeaf {
99
99
  // branch
100
100
  public children?: ILeaf[]
101
101
 
102
- // other
103
- public noBounds?: boolean
104
-
105
102
  public destroyed: boolean
106
103
 
107
104
 
@@ -115,8 +112,10 @@ export class Leaf implements ILeaf {
115
112
  public reset(data?: ILeafInputData): void {
116
113
  if (this.leafer) this.leafer.forceRender(this.__world) // fix: add old bounds rendering
117
114
 
118
- this.__world = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0, scaleX: 1, scaleY: 1 }
119
- if (data !== null) this.__local = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0 }
115
+ if (data as any !== 0) { // 设为 0 时可用于 text boxStyle 节省开销
116
+ this.__world = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0, scaleX: 1, scaleY: 1 }
117
+ if (data !== null) this.__local = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0 }
118
+ }
120
119
 
121
120
  this.__worldOpacity = 1
122
121
 
@@ -335,9 +334,10 @@ export class Leaf implements ILeaf {
335
334
  public __getNowWorld(options: IRenderOptions): IMatrixWithBoundsScaleData {
336
335
  if (options.matrix) {
337
336
  if (!this.__cameraWorld) this.__cameraWorld = {} as IMatrixWithBoundsScaleData
338
- const cameraWorld = this.__cameraWorld
339
- multiplyParent(this.__world, options.matrix, cameraWorld, undefined, this.__world)
337
+ const cameraWorld = this.__cameraWorld, world = this.__world
338
+ multiplyParent(world, options.matrix, cameraWorld, undefined, world)
340
339
  toOuterOf(this.__layout.renderBounds, cameraWorld, cameraWorld)
340
+ cameraWorld.half !== world.half && (cameraWorld.half = world.half)
341
341
  return cameraWorld
342
342
  } else {
343
343
  return this.__world
@@ -561,7 +561,7 @@ export class Leaf implements ILeaf {
561
561
 
562
562
  public __drawFast(_canvas: ILeaferCanvas, _options: IRenderOptions): void { }
563
563
 
564
- public __draw(_canvas: ILeaferCanvas, _options: IRenderOptions): void { }
564
+ public __draw(_canvas: ILeaferCanvas, _options: IRenderOptions, _originCanvas?: ILeaferCanvas): void { }
565
565
 
566
566
 
567
567
  public __clip(_canvas: ILeaferCanvas, _options: IRenderOptions): void { }
package/types/index.d.ts CHANGED
@@ -51,7 +51,6 @@ declare class Leaf implements ILeaf {
51
51
  __captureMap?: IEventListenerMap;
52
52
  __bubbleMap?: IEventListenerMap;
53
53
  children?: ILeaf[];
54
- noBounds?: boolean;
55
54
  destroyed: boolean;
56
55
  constructor(data?: ILeafInputData);
57
56
  reset(data?: ILeafInputData): void;
@@ -154,7 +153,7 @@ declare class Leaf implements ILeaf {
154
153
  __updateHitCanvas(): void;
155
154
  __render(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
156
155
  __drawFast(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
157
- __draw(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
156
+ __draw(_canvas: ILeaferCanvas, _options: IRenderOptions, _originCanvas?: ILeaferCanvas): void;
158
157
  __clip(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
159
158
  __renderShape(_canvas: ILeaferCanvas, _options: IRenderOptions, _ignoreFill?: boolean, _ignoreStroke?: boolean): void;
160
159
  __updateWorldOpacity(): void;