mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
fix: draw the level based on pixel density ratio
This commit is contained in:
parent
a3d91fe237
commit
39811d9300
@ -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)) {
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user