mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-17 23:33:14 +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(
|
var currentZeroRatio = this.viewport.deltaPixelsFromPointsNoRotate(
|
||||||
this.source.getPixelRatio(0), true).x *
|
this.source.getPixelRatio(0), true).x *
|
||||||
this._scaleSpring.current.value;
|
this._scaleSpring.current.value * $.pixelDensityRatio;
|
||||||
var highestLevel = Math.min(
|
var highestLevel = Math.min(
|
||||||
Math.abs(this.source.maxLevel),
|
Math.abs(this.source.maxLevel),
|
||||||
Math.abs(Math.floor(
|
Math.abs(Math.floor(
|
||||||
@ -1082,7 +1082,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
var currentRenderPixelRatio = viewport.deltaPixelsFromPointsNoRotate(
|
var currentRenderPixelRatio = viewport.deltaPixelsFromPointsNoRotate(
|
||||||
this.source.getPixelRatio(level),
|
this.source.getPixelRatio(level),
|
||||||
true
|
true
|
||||||
).x * this._scaleSpring.current.value;
|
).x * this._scaleSpring.current.value * $.pixelDensityRatio;
|
||||||
|
|
||||||
if (level === lowestLevel ||
|
if (level === lowestLevel ||
|
||||||
(!haveDrawn && currentRenderPixelRatio >= this.minPixelRatio)) {
|
(!haveDrawn && currentRenderPixelRatio >= this.minPixelRatio)) {
|
||||||
|
@ -401,6 +401,13 @@ $.Viewer = function( options ) {
|
|||||||
debugGridColor: this.debugGridColor
|
debugGridColor: this.debugGridColor
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
console.log("Windows is resized...");
|
||||||
|
_this.world.resetItems();
|
||||||
|
_this.forceRedraw();
|
||||||
|
}
|
||||||
|
$.addEvent( window, 'resize', resize );
|
||||||
|
|
||||||
// Overlay container
|
// Overlay container
|
||||||
this.overlaysContainer = $.makeNeutralElement( "div" );
|
this.overlaysContainer = $.makeNeutralElement( "div" );
|
||||||
this.canvas.appendChild( this.overlaysContainer );
|
this.canvas.appendChild( this.overlaysContainer );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user