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