mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Merge pull request #1123 from avandecreme/simple_image_fix
Fix simple image being drawn twice. Fix #1113
This commit is contained in:
commit
da2068a334
@ -356,6 +356,15 @@ $.TileSource.prototype = {
|
|||||||
var x = Math.floor(pixelX / this.getTileWidth(level));
|
var x = Math.floor(pixelX / this.getTileWidth(level));
|
||||||
var y = Math.floor(pixelY / this.getTileHeight(level));
|
var y = Math.floor(pixelY / this.getTileHeight(level));
|
||||||
|
|
||||||
|
// When point.x == 1 or point.y == 1 / this.aspectRatio we want to
|
||||||
|
// return the last tile of the row/column
|
||||||
|
if (point.x >= 1) {
|
||||||
|
x = this.getNumTiles(level).x - 1;
|
||||||
|
}
|
||||||
|
if (point.y >= 1 / this.aspectRatio) {
|
||||||
|
y = this.getNumTiles(level).y - 1;
|
||||||
|
}
|
||||||
|
|
||||||
return new $.Point(x, y);
|
return new $.Point(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -85,6 +85,17 @@
|
|||||||
assertTileAtPoint(level, new OpenSeadragon.Point(0.5, 0.5), new OpenSeadragon.Point(0, 0));
|
assertTileAtPoint(level, new OpenSeadragon.Point(0.5, 0.5), new OpenSeadragon.Point(0, 0));
|
||||||
assertTileAtPoint(level, new OpenSeadragon.Point(1, 10 / 15), new OpenSeadragon.Point(0, 0));
|
assertTileAtPoint(level, new OpenSeadragon.Point(1, 10 / 15), new OpenSeadragon.Point(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test for issue #1113
|
||||||
|
tileSource = new OpenSeadragon.TileSource({
|
||||||
|
width: 1006,
|
||||||
|
height: 1009,
|
||||||
|
tileWidth: 1006,
|
||||||
|
tileHeight: 1009,
|
||||||
|
tileOverlap: 0,
|
||||||
|
maxLevel: 0,
|
||||||
|
});
|
||||||
|
assertTileAtPoint(0, new OpenSeadragon.Point(1, 1009 / 1006), new OpenSeadragon.Point(0, 0));
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
Loading…
Reference in New Issue
Block a user