diff --git a/src/tiledimage.js b/src/tiledimage.js index 74ffacef..ccc51601 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1018,7 +1018,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag ); var currentZeroRatio = this.viewport.deltaPixelsFromPointsNoRotate( this.source.getPixelRatio(0), true).x * - this._scaleSpring.current.value; + this._scaleSpring.current.value * $.pixelDensityRatio; var highestLevel = Math.min( Math.abs(this.source.maxLevel), Math.abs(Math.floor( @@ -1082,7 +1082,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag var currentRenderPixelRatio = viewport.deltaPixelsFromPointsNoRotate( this.source.getPixelRatio(level), true - ).x * this._scaleSpring.current.value; + ).x * this._scaleSpring.current.value * $.pixelDensityRatio; if (level === lowestLevel || (!haveDrawn && currentRenderPixelRatio >= this.minPixelRatio)) { diff --git a/src/viewer.js b/src/viewer.js index b5b24318..ff958e06 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -401,6 +401,13 @@ $.Viewer = function( options ) { debugGridColor: this.debugGridColor }); + function resize() { + console.log("Windows is resized..."); + _this.world.resetItems(); + _this.forceRedraw(); + } + $.addEvent( window, 'resize', resize ); + // Overlay container this.overlaysContainer = $.makeNeutralElement( "div" ); this.canvas.appendChild( this.overlaysContainer );