Revert "Merge pull request #2059 from kim-sanghoon/fix/getLevelScale"

This reverts commit 1454ac791a, reversing
changes made to fcca75c57e.
This commit is contained in:
Sanghoon Kim 2021-11-23 16:22:41 +09:00
parent b3196a9756
commit 91793ce752

View File

@ -284,14 +284,10 @@ $.TileSource.prototype = {
// see https://github.com/openseadragon/openseadragon/issues/22
// we use the tilesources implementation of getLevelScale to generate
// a memoized re-implementation
var maxLevel = Math.ceil(
Math.log( Math.max( this.dimensions.x, this.dimensions.y ) ) /
Math.log( 2 )
),
levelScaleCache = {},
var levelScaleCache = {},
i;
for( i = 0; i <= maxLevel; i++ ){
levelScaleCache[ i ] = 1 / Math.pow(2, maxLevel - i);
for( i = 0; i <= this.maxLevel; i++ ){
levelScaleCache[ i ] = 1 / Math.pow(2, this.maxLevel - i);
}
this.getLevelScale = function( _level ){
return levelScaleCache[ _level ];