From ecebc3305f6636c661597449b84021dc385f81e9 Mon Sep 17 00:00:00 2001 From: VoidVolker Date: Fri, 29 Jul 2016 12:41:25 +0300 Subject: [PATCH] [=] Dropped useless calculations --- src/tilesource.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index 213cf3bd..eb5aabc0 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -345,13 +345,11 @@ $.TileSource.prototype = { * @param {OpenSeadragon.Point} point */ getTileAtPoint: function( level, point ) { - var levelScale = this.getLevelScale( level ), - numTiles = this.getNumTiles( level ), - pixel = point.times( this.dimensions.x * levelScale ), - tx = Math.floor( (pixel.x * numTiles.x) / (this.dimensions.x * levelScale) ), - ty = Math.floor( (pixel.y * numTiles.y) / (this.dimensions.y * levelScale) ); - - return new $.Point( tx, ty ); + var numTiles = this.getNumTiles( level ); + return new $.Point( + Math.floor( (point.x * numTiles.x) / 1 ), + Math.floor( (point.y * numTiles.y * this.dimensions.x) / this.dimensions.y ) + ); }, /**