@leafer/canvas 1.5.0 → 1.5.1

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.5.0",
3
+ "version": "1.5.1",
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.5.0",
26
- "@leafer/list": "1.5.0",
27
- "@leafer/math": "1.5.0",
28
- "@leafer/data": "1.5.0",
29
- "@leafer/path": "1.5.0",
30
- "@leafer/debug": "1.5.0",
31
- "@leafer/platform": "1.5.0"
25
+ "@leafer/file": "1.5.1",
26
+ "@leafer/list": "1.5.1",
27
+ "@leafer/math": "1.5.1",
28
+ "@leafer/data": "1.5.1",
29
+ "@leafer/path": "1.5.1",
30
+ "@leafer/debug": "1.5.1",
31
+ "@leafer/platform": "1.5.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@leafer/interface": "1.5.0"
34
+ "@leafer/interface": "1.5.1"
35
35
  }
36
36
  }
@@ -51,7 +51,6 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
51
51
  constructor(config?: ILeaferCanvasConfig, manager?: ICanvasManager) {
52
52
  super()
53
53
  if (!config) config = minSize
54
- if (!config.pixelRatio) config.pixelRatio = Platform.devicePixelRatio
55
54
 
56
55
  this.manager = manager
57
56
  this.innerId = IncrementId.create(IncrementId.CNAVAS)
@@ -59,7 +58,7 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
59
58
  const { width, height, pixelRatio } = config
60
59
  this.autoLayout = !width || !height
61
60
 
62
- this.size.pixelRatio = pixelRatio
61
+ this.size.pixelRatio = pixelRatio | Platform.devicePixelRatio
63
62
  this.config = config
64
63
 
65
64
  this.init()
@@ -307,7 +306,7 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
307
306
  }
308
307
 
309
308
  public isSameSize(size: IScreenSizeData): boolean {
310
- return this.width === size.width && this.height === size.height && this.pixelRatio === size.pixelRatio
309
+ return this.width === size.width && this.height === size.height && (!size.pixelRatio || this.pixelRatio === size.pixelRatio)
311
310
  }
312
311
 
313
312
  // 需要有 manager变量