From 3fcd4aeee3da9371e1bc9866ccb2d62db811e29c Mon Sep 17 00:00:00 2001 From: ronnymikalsen Date: Fri, 26 Mar 2021 12:38:58 +0100 Subject: [PATCH] refactor: moved methods that belongs together closer --- src/viewer.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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(); + } } });