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