Improve code readability

This commit is contained in:
Lutz Helm 2019-12-17 17:58:57 +01:00
parent 8ae1edfd48
commit 07cb95e99b

View File

@ -397,10 +397,12 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
iiifQuality = "default." + this.tileFormat; iiifQuality = "default." + this.tileFormat;
} }
if ( levelWidth < tileWidth && levelHeight < tileHeight ){ if ( levelWidth < tileWidth && levelHeight < tileHeight ){
if ( this.version === 1 || levelWidth !== this.width ) { if ( levelWidth === this.width && this.version !== 1 ) {
iiifSize = levelWidth + "," + ( this.version === 3 ? levelHeight : "" );
} else {
iiifSize = "max"; iiifSize = "max";
} else if ( this.version === 3 ) {
iiifSize = levelWidth + "," + levelHeight;
} else {
iiifSize = levelWidth + ",";
} }
iiifRegion = 'full'; iiifRegion = 'full';
} else { } else {
@ -417,8 +419,10 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
iiifSizeH = Math.ceil( iiifTileH * scale ); iiifSizeH = Math.ceil( iiifTileH * scale );
if ( this.version !== 1 && iiifSizeW === this.width && ( this.version !== 3 || iiifSizeH === this.height ) ) { if ( this.version !== 1 && iiifSizeW === this.width && ( this.version !== 3 || iiifSizeH === this.height ) ) {
iiifSize = "max"; iiifSize = "max";
} else if (this.version === 3) {
iiifSize = iiifSizeW + "," + iiifSizeH;
} else { } else {
iiifSize = iiifSizeW + "," + ( this.version === 3 ? iiifSizeH : "" ); iiifSize = iiifSizeW + ",";
} }
} }
uri = [ this['@id'], iiifRegion, iiifSize, IIIF_ROTATION, iiifQuality ].join( '/' ); uri = [ this['@id'], iiifRegion, iiifSize, IIIF_ROTATION, iiifQuality ].join( '/' );