mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 14:53:14 +03:00
Merge branch 'master' into ig-loading
This commit is contained in:
commit
326e7f3e36
@ -39,6 +39,9 @@ OPENSEADRAGON CHANGELOG
|
||||
* Fixed: zoomTo/zoomBy ignore refPoint if immediately is true (#1184)
|
||||
* Enabled configuration of ImageLoader timeout (#1192)
|
||||
* Viewer.open() now supports an initialPage argument for sequenceMode (#1196)
|
||||
* Fixed: IIPImageServer didn't work with the latest OSD release (#1199)
|
||||
* Now clamping pixel ratio density to a minimum of 1, fixing display issues on low density devices (#1200)
|
||||
* Improved calculation for determining which level to load first (#1198)
|
||||
|
||||
2.2.1:
|
||||
|
||||
|
@ -140,7 +140,7 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
|
||||
|
||||
if (url && !options.tilesUrl) {
|
||||
options.tilesUrl = url.replace(
|
||||
/([^\/]+?)(\.(dzi|xml|js))?(\?[^\/]*)?\/?$/, '$1_files/');
|
||||
/([^\/]+?)(\.(dzi|xml|js)?(\?[^\/]*)?)?\/?$/, '$1_files/');
|
||||
|
||||
if (url.search(/\.(dzi|xml|js)\?/) != -1) {
|
||||
options.queryParams = url.match(/\?.*/);
|
||||
|
@ -875,7 +875,8 @@ function OpenSeadragon( options ){
|
||||
};
|
||||
|
||||
/**
|
||||
* A ratio comparing the device screen's pixel density to the canvas's backing store pixel density. Defaults to 1 if canvas isn't supported by the browser.
|
||||
* A ratio comparing the device screen's pixel density to the canvas's backing store pixel density,
|
||||
* clamped to a minimum of 1. Defaults to 1 if canvas isn't supported by the browser.
|
||||
* @member {Number} pixelDensityRatio
|
||||
* @memberof OpenSeadragon
|
||||
*/
|
||||
@ -888,7 +889,7 @@ function OpenSeadragon( options ){
|
||||
context.msBackingStorePixelRatio ||
|
||||
context.oBackingStorePixelRatio ||
|
||||
context.backingStorePixelRatio || 1;
|
||||
return devicePixelRatio / backingStoreRatio;
|
||||
return Math.max(devicePixelRatio, 1) / backingStoreRatio;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
@ -980,7 +980,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
||||
var targetZeroRatio = viewport.deltaPixelsFromPointsNoRotate(
|
||||
this.source.getPixelRatio(
|
||||
Math.max(
|
||||
this.source.getClosestLevel(viewport.containerSize) - 1,
|
||||
this.source.getClosestLevel(),
|
||||
0
|
||||
)
|
||||
),
|
||||
|
@ -320,25 +320,20 @@ $.TileSource.prototype = {
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @param {Rect} rect
|
||||
* @returns {Number} The highest level in this tile source that can be contained in a single tile.
|
||||
*/
|
||||
getClosestLevel: function( rect ) {
|
||||
getClosestLevel: function() {
|
||||
var i,
|
||||
tilesPerSide,
|
||||
tiles;
|
||||
|
||||
for( i = this.minLevel; i < this.maxLevel; i++ ){
|
||||
tiles = this.getNumTiles( i );
|
||||
tilesPerSide = new $.Point(
|
||||
Math.floor( rect.x / this.getTileWidth(i) ),
|
||||
Math.floor( rect.y / this.getTileHeight(i) )
|
||||
);
|
||||
|
||||
if( tiles.x + 1 >= tilesPerSide.x && tiles.y + 1 >= tilesPerSide.y ){
|
||||
for (i = this.minLevel + 1; i <= this.maxLevel; i++){
|
||||
tiles = this.getNumTiles(i);
|
||||
if (tiles.x > 1 || tiles.y > 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Math.max( 0, i - 1 );
|
||||
|
||||
return i - 1;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -36,6 +36,9 @@
|
||||
testImplicitTilesUrl(
|
||||
'/iiipsrv?DeepZoom=/path/my.dzi', '/iiipsrv?DeepZoom=/path/my_files/',
|
||||
'querystring in dzi url should not be ignored before slashes');
|
||||
testImplicitTilesUrl(
|
||||
'/fcg-bin/iipsrv.fcgi?Deepzoom=123test.tif.dzi', '/fcg-bin/iipsrv.fcgi?Deepzoom=123test.tif_files/',
|
||||
'filename in querystring does not have to contain slash');
|
||||
});
|
||||
|
||||
}());
|
||||
|
Loading…
x
Reference in New Issue
Block a user