mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
refactor: use pixelDensityRatio in getPixelRatio()
This commit is contained in:
parent
f0cf90df76
commit
47802c0bd7
@ -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 * $.pixelDensityRatio;
|
this._scaleSpring.current.value;
|
||||||
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 * $.pixelDensityRatio;
|
).x * this._scaleSpring.current.value;
|
||||||
|
|
||||||
if (level === lowestLevel ||
|
if (level === lowestLevel ||
|
||||||
(!haveDrawn && currentRenderPixelRatio >= this.minPixelRatio)) {
|
(!haveDrawn && currentRenderPixelRatio >= this.minPixelRatio)) {
|
||||||
|
@ -313,8 +313,8 @@ $.TileSource.prototype = {
|
|||||||
*/
|
*/
|
||||||
getPixelRatio: function( level ) {
|
getPixelRatio: function( level ) {
|
||||||
var imageSizeScaled = this.dimensions.times( this.getLevelScale( level ) ),
|
var imageSizeScaled = this.dimensions.times( this.getLevelScale( level ) ),
|
||||||
rx = 1.0 / imageSizeScaled.x,
|
rx = 1.0 / imageSizeScaled.x * $.pixelDensityRatio,
|
||||||
ry = 1.0 / imageSizeScaled.y;
|
ry = 1.0 / imageSizeScaled.y * $.pixelDensityRatio;
|
||||||
|
|
||||||
return new $.Point(rx, ry);
|
return new $.Point(rx, ry);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user