leafer-draw 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/dist/web.esm.js CHANGED
@@ -124,7 +124,7 @@ class LeaferCanvas extends LeaferCanvasBase {
124
124
  else {
125
125
  window.addEventListener('resize', this.windowListener = () => {
126
126
  const pixelRatio = Platform.devicePixelRatio;
127
- if (this.pixelRatio !== pixelRatio) {
127
+ if (!this.config.pixelRatio && this.pixelRatio !== pixelRatio) {
128
128
  const { width, height } = this;
129
129
  this.emitResize({ width, height, pixelRatio });
130
130
  }
@@ -141,7 +141,7 @@ class LeaferCanvas extends LeaferCanvasBase {
141
141
  checkAutoBounds(parentSize) {
142
142
  const view = this.view;
143
143
  const { x, y, width, height } = this.autoBounds.getBoundsFrom(parentSize);
144
- const size = { width, height, pixelRatio: Platform.devicePixelRatio };
144
+ const size = { width, height, pixelRatio: this.config.pixelRatio ? this.pixelRatio : Platform.devicePixelRatio };
145
145
  if (!this.isSameSize(size)) {
146
146
  const { style } = view;
147
147
  style.marginLeft = x + 'px';