From 91793ce752090c3e1b5aaaf57cf219af77f00a19 Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:22:41 +0900 Subject: [PATCH] Revert "Merge pull request #2059 from kim-sanghoon/fix/getLevelScale" This reverts commit 1454ac791a0a2d538a58678374b7829f7c3f1fbb, reversing changes made to fcca75c57e9707be8a552bb824c8b6f5f899ee75. --- src/tilesource.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index 32f10da8..aab7f134 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -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 ];