mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Merge pull request #1280 from avandecreme/fix_tile_at_point
Fix getTileAtPoint floating point computation error
This commit is contained in:
commit
248a001bb6
@ -360,7 +360,8 @@ $.TileSource.prototype = {
|
|||||||
if (point.x >= 1) {
|
if (point.x >= 1) {
|
||||||
x = this.getNumTiles(level).x - 1;
|
x = this.getNumTiles(level).x - 1;
|
||||||
}
|
}
|
||||||
if (point.y >= 1 / this.aspectRatio) {
|
var EPSILON = 1e-16;
|
||||||
|
if (point.y >= 1 / this.aspectRatio - EPSILON) {
|
||||||
y = this.getNumTiles(level).y - 1;
|
y = this.getNumTiles(level).y - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +96,17 @@
|
|||||||
maxLevel: 0,
|
maxLevel: 0,
|
||||||
});
|
});
|
||||||
assertTileAtPoint(0, new OpenSeadragon.Point(1, 1009 / 1006), new OpenSeadragon.Point(0, 0));
|
assertTileAtPoint(0, new OpenSeadragon.Point(1, 1009 / 1006), new OpenSeadragon.Point(0, 0));
|
||||||
|
|
||||||
|
// Test for issue #1276
|
||||||
|
tileSource = new OpenSeadragon.TileSource({
|
||||||
|
width: 4036,
|
||||||
|
height: 1239,
|
||||||
|
tileWidth: 4036,
|
||||||
|
tileHeight: 1239,
|
||||||
|
tileOverlap: 0,
|
||||||
|
maxLevel: 0,
|
||||||
|
});
|
||||||
|
assertTileAtPoint(0, new OpenSeadragon.Point(1, 1239 / 4036), new OpenSeadragon.Point(0, 0));
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
Loading…
Reference in New Issue
Block a user