Merge pull request #987 from VoidVolker/master

[=] Wrap fix for #555
This commit is contained in:
Ian Gilman 2016-07-29 13:21:24 -07:00 committed by GitHub
commit 6f6207412c
4 changed files with 11 additions and 25 deletions

View File

@ -166,14 +166,6 @@
return new $.Point(0, 0); return new $.Point(0, 0);
} }
}, },
/**
* @function
* @param {Number} level
* @param {OpenSeadragon.Point} point
*/
getTileAtPoint: function (level, point) {
return new $.Point(0, 0);
},
/** /**
* Retrieves a tile url * Retrieves a tile url
* @function * @function

View File

@ -169,16 +169,6 @@ $.extend( $.LegacyTileSource.prototype, $.TileSource.prototype, /** @lends OpenS
} }
}, },
/**
* @function
* @param {Number} level
* @param {OpenSeadragon.Point} point
*/
getTileAtPoint: function( level, point ) {
return new $.Point( 0, 0 );
},
/** /**
* This method is not implemented by this class other than to throw an Error * This method is not implemented by this class other than to throw an Error
* announcing you have to implement it. Because of the variety of tile * announcing you have to implement it. Because of the variety of tile

View File

@ -967,10 +967,14 @@ function updateLevel( tiledImage, haveDrawn, drawLevel, level, levelOpacity, lev
resetCoverage( tiledImage.coverage, level ); resetCoverage( tiledImage.coverage, level );
if ( !tiledImage.wrapHorizontal ) { if ( tiledImage.wrapHorizontal ) {
tileTL.x -= 1; // left invisible column (othervise we will have empty space after scroll at left)
} else {
tileBR.x = Math.min( tileBR.x, numberOfTiles.x - 1 ); tileBR.x = Math.min( tileBR.x, numberOfTiles.x - 1 );
} }
if ( !tiledImage.wrapVertical ) { if ( tiledImage.wrapVertical ) {
tileTL.y -= 1; // top invisible row (othervise we will have empty space after scroll at top)
} else {
tileBR.y = Math.min( tileBR.y, numberOfTiles.y - 1 ); tileBR.y = Math.min( tileBR.y, numberOfTiles.y - 1 );
} }

View File

@ -345,11 +345,11 @@ $.TileSource.prototype = {
* @param {OpenSeadragon.Point} point * @param {OpenSeadragon.Point} point
*/ */
getTileAtPoint: function( level, point ) { getTileAtPoint: function( level, point ) {
var pixel = point.times( this.dimensions.x ).times( this.getLevelScale(level) ), var numTiles = this.getNumTiles( level );
tx = Math.floor( pixel.x / this.getTileWidth(level) ), return new $.Point(
ty = Math.floor( pixel.y / this.getTileHeight(level) ); Math.floor( (point.x * numTiles.x) / 1 ),
Math.floor( (point.y * numTiles.y * this.dimensions.x) / this.dimensions.y )
return new $.Point( tx, ty ); );
}, },
/** /**