From 01e5b08ac91d2d0880e3350999cc0eef0dd09c80 Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Wed, 27 Nov 2024 13:42:55 +0100 Subject: [PATCH] patch: typo on rendering --- modules/empation-api/tilesource.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/empation-api/tilesource.js b/modules/empation-api/tilesource.js index 2c40ec1..559610f 100644 --- a/modules/empation-api/tilesource.js +++ b/modules/empation-api/tilesource.js @@ -20,8 +20,8 @@ OpenSeadragon.TiledImage.prototype._loadTile = function(tile, time ) { // return canvas; // } // Treats tiles correctly, supposing all tiles have the same size (or smaller if they do not fit) - let dw = tile.sourceBounds.x / tileWidth, - dh = tile.sourceBounds.y / tileHeight; + let dw = tile.sourceBounds.width / tileWidth, + dh = tile.sourceBounds.height / tileHeight; //the value is expected to be up to 1 if sizes equal if (dw < 0.999 || dh < 0.999) { @@ -34,8 +34,8 @@ OpenSeadragon.TiledImage.prototype._loadTile = function(tile, time ) { const canvas = document.createElement('canvas'), context = canvas.getContext('2d'), - desiredWidth = Math.max(tile.sourceBounds.x, 1), - desiredHeight = Math.max(tile.sourceBounds.y, 1); + desiredWidth = Math.max(tile.sourceBounds.width, 1), + desiredHeight = Math.max(tile.sourceBounds.height, 1); canvas.width = Math.max(desiredWidth, 1); canvas.height = Math.max(desiredHeight, 1); context.drawImage(image, 0, 0, desiredWidth, desiredHeight, 0, 0, desiredWidth, desiredHeight);