diff --git a/src/viewer.js b/src/viewer.js index f17621d6..612c753a 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1613,21 +1613,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, return this.world.removeItem(drawer); }, - /** - * Update pixel density ratio, clears all tiles and triggers updates for - * all items if the ratio has changed. - * @private - */ - _updatePixelDensityRatio: function() { - var previusPixelDensityRatio = $.pixelDensityRatio; - var currentPixelDensityRatio = $.getCurrentPixelDensityRatio(); - if (previusPixelDensityRatio !== currentPixelDensityRatio) { - $.pixelDensityRatio = currentPixelDensityRatio; - this.world.resetItems(); - this.forceRedraw(); - } - }, - /** * Force the viewer to redraw its contents. * @returns {OpenSeadragon.Viewer} Chainable. @@ -2303,6 +2288,21 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, */ _removeUpdatePixelDensityRatioEvent: function() { $.removeEvent( window, 'resize', this._updatePixelDensityRatioBind ); + }, + + /** + * Update pixel density ratio, clears all tiles and triggers updates for + * all items if the ratio has changed. + * @private + */ + _updatePixelDensityRatio: function() { + var previusPixelDensityRatio = $.pixelDensityRatio; + var currentPixelDensityRatio = $.getCurrentPixelDensityRatio(); + if (previusPixelDensityRatio !== currentPixelDensityRatio) { + $.pixelDensityRatio = currentPixelDensityRatio; + this.world.resetItems(); + this.forceRedraw(); + } } });