mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 22:26:10 +03:00
Sort levelSizes instead of sizes
This commit is contained in:
parent
5542ead48b
commit
b92a428e88
@ -145,7 +145,7 @@ $.IIIFTileSource = function( options ){
|
||||
if( this.sizes ) {
|
||||
var sizeLength = this.sizes.length;
|
||||
if ( (sizeLength === options.maxLevel) || (sizeLength === options.maxLevel + 1) ) {
|
||||
this.levelSizes = this.sizes;
|
||||
this.levelSizes = this.sizes.slice().sort(( size1, size2 ) => size1.width - size2.width);
|
||||
// Need to take into account that the list may or may not include the full resolution size
|
||||
if( sizeLength === options.maxLevel ) {
|
||||
this.levelSizes.push( {width: this.width, height: this.height} );
|
||||
@ -269,9 +269,6 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
||||
}
|
||||
}
|
||||
}
|
||||
data.sizes = data.sizes && data.sizes.sort(
|
||||
( size1, size2 ) => size1.width - size2.width
|
||||
);
|
||||
return data;
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user