renamed psuedo-private accessor _getNumTiles to actual private numberOfTiles

This commit is contained in:
thatcher 2012-01-11 18:32:17 -05:00
parent c8b4197f79
commit 8424c78c4b
2 changed files with 20 additions and 18 deletions

View File

@ -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( $ ){

View File

@ -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 ));