mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
refactor: moved methods that belongs together closer
This commit is contained in:
parent
47802c0bd7
commit
3fcd4aeee3
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user