fix #2519 by checking minimumOverlapRequired on a per-tiled image basis

This commit is contained in:
Tom 2024-04-28 08:38:03 -04:00
parent 49e2d7a987
commit 8b401e65e3
5 changed files with 22 additions and 7 deletions

View File

@ -143,10 +143,12 @@ class CanvasDrawer extends OpenSeadragon.DrawerBase{
} }
/** /**
* @param {TiledImage} tiledImage the tiled image that is calling the function
* @returns {Boolean} Whether this drawer requires enforcing minimum tile overlap to avoid showing seams. * @returns {Boolean} Whether this drawer requires enforcing minimum tile overlap to avoid showing seams.
* @private
*/ */
minimumOverlapRequired() { minimumOverlapRequired(tiledImage) {
return true; return true;
} }

View File

@ -141,12 +141,13 @@ OpenSeadragon.DrawerBase = class DrawerBase{
} }
/** /**
* @param {TiledImage} tiledImage the tiled image that is calling the function
* @returns {Boolean} Whether this drawer requires enforcing minimum tile overlap to avoid showing seams. * @returns {Boolean} Whether this drawer requires enforcing minimum tile overlap to avoid showing seams.
* @private * @private
*/ */
minimumOverlapRequired() { minimumOverlapRequired(tiledImage) {
return false; return false;
} }
/** /**

View File

@ -86,11 +86,13 @@ class HTMLDrawer extends OpenSeadragon.DrawerBase{
} }
/** /**
* @param {TiledImage} tiledImage the tiled image that is calling the function
* @returns {Boolean} Whether this drawer requires enforcing minimum tile overlap to avoid showing seams. * @returns {Boolean} Whether this drawer requires enforcing minimum tile overlap to avoid showing seams.
* @private
*/ */
minimumOverlapRequired() { minimumOverlapRequired(tiledImage) {
return true; return true;
} }
/** /**
* create the HTML element (e.g. canvas, div) that the image will be drawn into * create the HTML element (e.g. canvas, div) that the image will be drawn into

View File

@ -1706,7 +1706,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
tileCenter = positionT.plus( sizeT.divide( 2 ) ), tileCenter = positionT.plus( sizeT.divide( 2 ) ),
tileSquaredDistance = viewportCenter.squaredDistanceTo( tileCenter ); tileSquaredDistance = viewportCenter.squaredDistanceTo( tileCenter );
if(this.viewer.drawer.minimumOverlapRequired()){ if(this.viewer.drawer.minimumOverlapRequired(this)){
if ( !overlap ) { if ( !overlap ) {
sizeC = sizeC.plus( new $.Point(1, 1)); sizeC = sizeC.plus( new $.Point(1, 1));
} }

View File

@ -210,6 +210,16 @@
return 'webgl'; return 'webgl';
} }
/**
* @param {TiledImage} tiledImage the tiled image that is calling the function
* @returns {Boolean} Whether this drawer requires enforcing minimum tile overlap to avoid showing seams.
* @private
*/
minimumOverlapRequired(tiledImage) {
// return true if the tiled image is tainted, since the backup canvas drawer will be used.
return tiledImage.isTainted();
}
/** /**
* create the HTML element (canvas in this case) that the image will be drawn into * create the HTML element (canvas in this case) that the image will be drawn into
* @private * @private