mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 22:56:11 +03:00
Addressing seams that appear in wrap mode on Safari and Firefox
This commit is contained in:
parent
36dd37b931
commit
a49bbbcb06
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#
|
* @memberof OpenSeadragon.Tile#
|
||||||
*/
|
*/
|
||||||
this.beingDrawn = false;
|
this.beingDrawn = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timestamp the tile was last touched.
|
* Timestamp the tile was last touched.
|
||||||
* @member {Number} lastTouchTime
|
* @member {Number} lastTouchTime
|
||||||
* @memberof OpenSeadragon.Tile#
|
* @memberof OpenSeadragon.Tile#
|
||||||
*/
|
*/
|
||||||
this.lastTouchTime = 0;
|
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 */
|
/** @lends OpenSeadragon.Tile.prototype */
|
||||||
|
@ -1405,7 +1405,7 @@ function getTile(
|
|||||||
bounds.x += ( x - xMod ) / numTiles.x;
|
bounds.x += ( x - xMod ) / numTiles.x;
|
||||||
bounds.y += (worldHeight / worldWidth) * (( y - yMod ) / numTiles.y);
|
bounds.y += (worldHeight / worldWidth) * (( y - yMod ) / numTiles.y);
|
||||||
|
|
||||||
tilesMatrix[ level ][ x ][ y ] = new $.Tile(
|
tile = new $.Tile(
|
||||||
level,
|
level,
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
@ -1416,6 +1416,16 @@ function getTile(
|
|||||||
tiledImage.loadTilesWithAjax,
|
tiledImage.loadTilesWithAjax,
|
||||||
ajaxHeaders
|
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 ];
|
tile = tilesMatrix[ level ][ x ][ y ];
|
||||||
@ -1602,6 +1612,14 @@ function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility,
|
|||||||
sizeC = sizeC.plus( new $.Point( 1, 1 ) );
|
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.position = positionC;
|
||||||
tile.size = sizeC;
|
tile.size = sizeC;
|
||||||
tile.squaredDistance = tileSquaredDistance;
|
tile.squaredDistance = tileSquaredDistance;
|
||||||
|
Loading…
Reference in New Issue
Block a user