mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
Merge pull request #1305 from openseadragon/seams
Addressing seams that appear in wrap mode on Safari and Firefox
This commit is contained in:
commit
1cb557b2cb
15
src/tile.js
15
src/tile.js
@ -199,12 +199,27 @@ $.Tile = function(level, x, y, bounds, exists, url, context2D, loadWithAjax, aja
|
||||
* @memberof OpenSeadragon.Tile#
|
||||
*/
|
||||
this.beingDrawn = false;
|
||||
|
||||
/**
|
||||
* Timestamp the tile was last touched.
|
||||
* @member {Number} lastTouchTime
|
||||
* @memberof OpenSeadragon.Tile#
|
||||
*/
|
||||
this.lastTouchTime = 0;
|
||||
|
||||
/**
|
||||
* Whether this tile is in the right-most column for its level.
|
||||
* @member {Boolean} isRightMost
|
||||
* @memberof OpenSeadragon.Tile#
|
||||
*/
|
||||
this.isRightMost = false;
|
||||
|
||||
/**
|
||||
* Whether this tile is in the bottom-most row for its level.
|
||||
* @member {Boolean} isBottomMost
|
||||
* @memberof OpenSeadragon.Tile#
|
||||
*/
|
||||
this.isBottomMost = false;
|
||||
};
|
||||
|
||||
/** @lends OpenSeadragon.Tile.prototype */
|
||||
|
@ -1405,7 +1405,7 @@ function getTile(
|
||||
bounds.x += ( x - xMod ) / numTiles.x;
|
||||
bounds.y += (worldHeight / worldWidth) * (( y - yMod ) / numTiles.y);
|
||||
|
||||
tilesMatrix[ level ][ x ][ y ] = new $.Tile(
|
||||
tile = new $.Tile(
|
||||
level,
|
||||
x,
|
||||
y,
|
||||
@ -1416,6 +1416,16 @@ function getTile(
|
||||
tiledImage.loadTilesWithAjax,
|
||||
ajaxHeaders
|
||||
);
|
||||
|
||||
if (xMod === numTiles.x - 1) {
|
||||
tile.isRightMost = true;
|
||||
}
|
||||
|
||||
if (yMod === numTiles.y - 1) {
|
||||
tile.isBottomMost = true;
|
||||
}
|
||||
|
||||
tilesMatrix[ level ][ x ][ y ] = tile;
|
||||
}
|
||||
|
||||
tile = tilesMatrix[ level ][ x ][ y ];
|
||||
@ -1602,6 +1612,14 @@ function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility,
|
||||
sizeC = sizeC.plus( new $.Point( 1, 1 ) );
|
||||
}
|
||||
|
||||
if (tile.isRightMost && tiledImage.wrapHorizontal) {
|
||||
sizeC.x += 0.75; // Otherwise Firefox and Safari show seams
|
||||
}
|
||||
|
||||
if (tile.isBottomMost && tiledImage.wrapVertical) {
|
||||
sizeC.y += 0.75; // Otherwise Firefox and Safari show seams
|
||||
}
|
||||
|
||||
tile.position = positionC;
|
||||
tile.size = sizeC;
|
||||
tile.squaredDistance = tileSquaredDistance;
|
||||
|
Loading…
Reference in New Issue
Block a user