diff --git a/openseadragon.js b/openseadragon.js index 087f9530..8abbf755 100644 --- a/openseadragon.js +++ b/openseadragon.js @@ -3446,14 +3446,6 @@ $.Drawer = function(source, viewport, elmt) { $.Drawer.prototype = { - _getNumTiles: function(level) { - if (!this.cacheNumTiles[level]) { - this.cacheNumTiles[level] = this.source.getNumTiles(level); - } - - return this.cacheNumTiles[level]; - }, - _getPixelRatio: function(level) { if (!this.cachePixelRatios[level]) { this.cachePixelRatios[level] = this.source.getPixelRatio(level); @@ -3772,7 +3764,7 @@ $.Drawer.prototype = { var tileTL = this.source.getTileAtPoint(level, viewportTL); var tileBR = this.source.getTileAtPoint(level, viewportBR); - var numTiles = this._getNumTiles(level); + var numTiles = numberOfTiles( this, level ); var numTilesX = numTiles.x; var numTilesY = numTiles.y; if (!wrapHorizontal) { @@ -4010,6 +4002,15 @@ function finishLoadingImage( image, callback, successful, jobid ){ }; +function numberOfTiles( drawer, level ){ + + if ( !drawer.cacheNumTiles[ level ] ) { + drawer.cacheNumTiles[ level ] = drawer.source.getNumTiles( level ); + } + + return drawer.cacheNumTiles[ level ]; +}; + }( OpenSeadragon )); (function( $ ){ diff --git a/src/drawer.js b/src/drawer.js index 74bb0217..0a0d2b4b 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -74,14 +74,6 @@ $.Drawer = function(source, viewport, elmt) { $.Drawer.prototype = { - _getNumTiles: function(level) { - if (!this.cacheNumTiles[level]) { - this.cacheNumTiles[level] = this.source.getNumTiles(level); - } - - return this.cacheNumTiles[level]; - }, - _getPixelRatio: function(level) { if (!this.cachePixelRatios[level]) { this.cachePixelRatios[level] = this.source.getPixelRatio(level); @@ -400,7 +392,7 @@ $.Drawer.prototype = { var tileTL = this.source.getTileAtPoint(level, viewportTL); var tileBR = this.source.getTileAtPoint(level, viewportBR); - var numTiles = this._getNumTiles(level); + var numTiles = numberOfTiles( this, level ); var numTilesX = numTiles.x; var numTilesY = numTiles.y; if (!wrapHorizontal) { @@ -638,4 +630,13 @@ function finishLoadingImage( image, callback, successful, jobid ){ }; +function numberOfTiles( drawer, level ){ + + if ( !drawer.cacheNumTiles[ level ] ) { + drawer.cacheNumTiles[ level ] = drawer.source.getNumTiles( level ); + } + + return drawer.cacheNumTiles[ level ]; +}; + }( OpenSeadragon ));