@leafer/canvas 1.2.0 → 1.2.2

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/canvas",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "@leafer/canvas",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,15 +22,15 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/file": "1.2.0",
26
- "@leafer/list": "1.2.0",
27
- "@leafer/math": "1.2.0",
28
- "@leafer/data": "1.2.0",
29
- "@leafer/path": "1.2.0",
30
- "@leafer/debug": "1.2.0",
31
- "@leafer/platform": "1.2.0"
25
+ "@leafer/file": "1.2.2",
26
+ "@leafer/list": "1.2.2",
27
+ "@leafer/math": "1.2.2",
28
+ "@leafer/data": "1.2.2",
29
+ "@leafer/path": "1.2.2",
30
+ "@leafer/debug": "1.2.2",
31
+ "@leafer/platform": "1.2.2"
32
32
  },
33
33
  "devDependencies": {
34
- "@leafer/interface": "1.2.0"
34
+ "@leafer/interface": "1.2.2"
35
35
  }
36
36
  }
@@ -86,11 +86,11 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
86
86
 
87
87
  // ---
88
88
 
89
- public resize(size: IScreenSizeData): void {
89
+ public resize(size: IScreenSizeData, safeResize = true): void {
90
90
  if (this.isSameSize(size)) return
91
91
 
92
92
  let takeCanvas: ILeaferCanvas
93
- if (this.context && !this.unreal && this.width) {
93
+ if (this.context && !this.unreal && safeResize && this.width) {
94
94
  takeCanvas = this.getSameCanvas()
95
95
  takeCanvas.copyWorld(this)
96
96
  }
package/types/index.d.ts CHANGED
@@ -109,7 +109,7 @@ declare class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
109
109
  toBlob(_type?: IExportFileType, _quality?: number): Promise<IBlob>;
110
110
  toDataURL(_type?: IExportImageType, _quality?: number): string | Promise<string>;
111
111
  saveAs(_filename: string, _quality?: number): Promise<boolean>;
112
- resize(size: IScreenSizeData): void;
112
+ resize(size: IScreenSizeData, safeResize?: boolean): void;
113
113
  updateViewSize(): void;
114
114
  updateClientBounds(): void;
115
115
  getClientBounds(update?: boolean): IBoundsData;