Wraparound now works for images of other widths than 1

This commit is contained in:
Ian Gilman 2014-11-05 15:24:31 -08:00
parent e52e2fef34
commit a9c9478752
2 changed files with 13 additions and 12 deletions

View File

@ -545,8 +545,8 @@ function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, worldWid
exists = tileSource.tileExists( level, xMod, yMod ); exists = tileSource.tileExists( level, xMod, yMod );
url = tileSource.getTileUrl( level, xMod, yMod ); url = tileSource.getTileUrl( level, xMod, yMod );
bounds.x += worldWidth * ( x - xMod ) / numTiles.x; bounds.x += ( x - xMod ) / numTiles.x;
bounds.y += worldHeight * ( y - yMod ) / numTiles.y; bounds.y += (worldHeight / worldWidth) * (( y - yMod ) / numTiles.y);
tilesMatrix[ level ][ x ][ y ] = new $.Tile( tilesMatrix[ level ][ x ][ y ] = new $.Tile(
level, level,

View File

@ -16,8 +16,8 @@
debugMode: true, debugMode: true,
zoomPerScroll: 1.02, zoomPerScroll: 1.02,
showNavigator: testNavigator, showNavigator: testNavigator,
wrapHorizontal: true, // wrapHorizontal: true,
wrapVertical: true, // wrapVertical: true,
id: "contentDiv", id: "contentDiv",
prefixUrl: "../../../build/openseadragon/images/" prefixUrl: "../../../build/openseadragon/images/"
}; };
@ -96,7 +96,9 @@
this.viewer.addHandler('open', function() { this.viewer.addHandler('open', function() {
}); });
this.viewer.open("../../data/testpattern.dzi"); this.viewer.open({
tileSource: "../../data/testpattern.dzi"
});
}, },
// ---------- // ----------
@ -133,15 +135,14 @@
// ---------- // ----------
crossTest2: function() { crossTest2: function() {
this.viewer.open([ this.viewer.open([
// { {
// tileSource: "../../data/tall.dzi", tileSource: "../../data/tall.dzi",
// x: 1.5, x: 1.5,
// y: 0, y: 0,
// width: 1 width: 1
// }, },
{ {
tileSource: '../../data/wide.dzi', tileSource: '../../data/wide.dzi',
opacity: 1,
x: 0, x: 0,
y: 1.5, y: 1.5,
height: 1 height: 1