Skip to content

Commit

Permalink
Add if check for MultiPageViewLayout.reset function.
Browse files Browse the repository at this point in the history
Fix issue with rounding errors.

Signed-off-by: Gökay Şatır <[email protected]>
Change-Id: I88edaf2117998b14a3bfdcb6741dc9ba6411fd16
  • Loading branch information
gokaysatir committed Mar 8, 2025
1 parent 2a5750c commit 588bd00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions browser/src/app/TilesMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,8 @@ class TileManager {
tileWids.push(tile && tile.wireId !== undefined ? tile.wireId : 0);

const twips = new L.Point(
Math.floor(coords.x * app.pixelsToTwips),
Math.floor(coords.y * app.pixelsToTwips),
Math.floor(coords.x / this.tileSize) * app.tile.size.x,
Math.floor(coords.y / this.tileSize) * app.tile.size.y,
);

tilePositionsX.push(twips.x);
Expand Down
3 changes: 2 additions & 1 deletion browser/src/layer/tile/CanvasTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3704,7 +3704,8 @@ L.CanvasTileLayer = L.Layer.extend({
var documentPos = documentBounds.min;
var documentEndPos = documentBounds.max;
app.sectionContainer.setDocumentBounds([documentPos.x, documentPos.y, documentEndPos.x, documentEndPos.y]);
MultiPageViewLayout.reset();
if (app.file.writer.multiPageView)
MultiPageViewLayout.reset();
}
},

Expand Down

0 comments on commit 588bd00

Please sign in to comment.