mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +03:00
Fix TileSource.getTileAtPoint
This commit is contained in:
parent
2821c8f67b
commit
cca6b47fc0
@ -345,11 +345,12 @@ $.TileSource.prototype = {
|
|||||||
* @param {OpenSeadragon.Point} point
|
* @param {OpenSeadragon.Point} point
|
||||||
*/
|
*/
|
||||||
getTileAtPoint: function(level, point) {
|
getTileAtPoint: function(level, point) {
|
||||||
var numTiles = this.getNumTiles( level );
|
var widthScaled = this.dimensions.x * this.getLevelScale(level);
|
||||||
return new $.Point(
|
var pixelX = point.x * widthScaled;
|
||||||
Math.floor( (point.x * numTiles.x) / 1 ),
|
var pixelY = point.y * widthScaled;
|
||||||
Math.floor( (point.y * numTiles.y * this.dimensions.x) / this.dimensions.y )
|
var x = Math.floor(pixelX / this.getTileWidth());
|
||||||
);
|
var y = Math.floor(pixelY / this.getTileHeight());
|
||||||
|
return new $.Point(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user