Skip to content

Commit

Permalink
tile: avoid rendering beyond document boundary
Browse files Browse the repository at this point in the history
problem:
i.e: if calc sheet has most of row hidden and remaining
rows don't cover the canvas area then
1. canvas center was incorrectly calculated based on
available area instead the required doc area
2. grids were drawn beyond the last visible raw

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I1f43e37e104c693b8f070271dac620385c0a2dd0
  • Loading branch information
lpranam committed Jan 22, 2025
1 parent 663fe34 commit bd7c417
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions browser/src/layer/tile/CanvasTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4154,8 +4154,8 @@ L.CanvasTileLayer = L.Layer.extend({
var mapElement = document.getElementById('map'); // map's size = tiles section's size.
mapElement.style.left = rectangle.getPxX1() + 'px';
mapElement.style.top = rectangle.getPxY1() + 'px';
mapElement.style.width = rectangle.getPxWidth() + 'px';
mapElement.style.height = rectangle.getPxHeight() + 'px';
mapElement.style.width = Math.min(rectangle.getPxWidth(), app.file.size.pixels[0]) + 'px';
mapElement.style.height = Math.min(rectangle.getPxHeight(), app.file.size.pixels[1]) + 'px';

tileContainer.style.width = rectangle.getPxWidth() + 'px';
tileContainer.style.height = rectangle.getPxHeight() + 'px';
Expand Down

0 comments on commit bd7c417

Please sign in to comment.