From a9c9478752cd06a70b5de27a54f8011c501015c8 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Wed, 5 Nov 2014 15:24:31 -0800 Subject: [PATCH] Wraparound now works for images of other widths than 1 --- src/tiledimage.js | 4 ++-- test/demo/collections/main.js | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index 4467d971..8079b375 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -545,8 +545,8 @@ function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, worldWid exists = tileSource.tileExists( level, xMod, yMod ); url = tileSource.getTileUrl( level, xMod, yMod ); - bounds.x += worldWidth * ( x - xMod ) / numTiles.x; - bounds.y += worldHeight * ( y - yMod ) / numTiles.y; + bounds.x += ( x - xMod ) / numTiles.x; + bounds.y += (worldHeight / worldWidth) * (( y - yMod ) / numTiles.y); tilesMatrix[ level ][ x ][ y ] = new $.Tile( level, diff --git a/test/demo/collections/main.js b/test/demo/collections/main.js index 2479166a..0e3ab824 100644 --- a/test/demo/collections/main.js +++ b/test/demo/collections/main.js @@ -16,8 +16,8 @@ debugMode: true, zoomPerScroll: 1.02, showNavigator: testNavigator, - wrapHorizontal: true, - wrapVertical: true, + // wrapHorizontal: true, + // wrapVertical: true, id: "contentDiv", prefixUrl: "../../../build/openseadragon/images/" }; @@ -96,7 +96,9 @@ this.viewer.addHandler('open', function() { }); - this.viewer.open("../../data/testpattern.dzi"); + this.viewer.open({ + tileSource: "../../data/testpattern.dzi" + }); }, // ---------- @@ -133,15 +135,14 @@ // ---------- crossTest2: function() { this.viewer.open([ - // { - // tileSource: "../../data/tall.dzi", - // x: 1.5, - // y: 0, - // width: 1 - // }, + { + tileSource: "../../data/tall.dzi", + x: 1.5, + y: 0, + width: 1 + }, { tileSource: '../../data/wide.dzi', - opacity: 1, x: 0, y: 1.5, height: 1