@leafer/canvas-web 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-web",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "@leafer/canvas-web",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,9 +22,9 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.5.0"
25
+ "@leafer/core": "1.5.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.5.0"
28
+ "@leafer/interface": "1.5.1"
29
29
  }
30
30
  }
@@ -157,7 +157,7 @@ export class LeaferCanvas extends LeaferCanvasBase {
157
157
  // check devicePixelRatio change
158
158
  window.addEventListener('resize', this.windowListener = () => {
159
159
  const pixelRatio = Platform.devicePixelRatio
160
- if (this.pixelRatio !== pixelRatio) {
160
+ if (!this.config.pixelRatio && this.pixelRatio !== pixelRatio) {
161
161
  const { width, height } = this
162
162
  this.emitResize({ width, height, pixelRatio })
163
163
  }
@@ -177,7 +177,7 @@ export class LeaferCanvas extends LeaferCanvasBase {
177
177
  protected checkAutoBounds(parentSize: ISizeData): void {
178
178
  const view = this.view
179
179
  const { x, y, width, height } = this.autoBounds.getBoundsFrom(parentSize)
180
- const size = { width, height, pixelRatio: Platform.devicePixelRatio } as IScreenSizeData
180
+ const size = { width, height, pixelRatio: this.config.pixelRatio ? this.pixelRatio : Platform.devicePixelRatio } as IScreenSizeData
181
181
  if (!this.isSameSize(size)) {
182
182
  const { style } = view
183
183
  style.marginLeft = x + 'px'