Skip to content

Commit

Permalink
patch: typo on rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiosa committed Nov 27, 2024
1 parent a101903 commit 01e5b08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/empation-api/tilesource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 01e5b08

Please sign in to comment.