fixes: ghost pages/tiles in writer

The issue is: On creating a page break on a empty writer file and
hitting backspace, the deleted page or parts of it is still rendered.

We get a 'status' message containing the document size every time it
changes. So avoid the issue do not draw tiles that are not within the
document area.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I88d1715e861f068326d28d2930d01e3b5355be02
This commit is contained in:
Dennis Francis 2021-03-11 16:59:08 +05:30 committed by Dennis Francis
parent 38ca7df677
commit b51cc9ce62

View file

@ -196,8 +196,8 @@ class TilesSection {
this.oscCtxs[i].fillRect(0, 0, this.offscreenCanvases[i].width, this.offscreenCanvases[i].height);
}
var tileRanges = ctx.paneBoundsList.map(this.sectionProperties.docLayer._pxBoundsToTileRange, this.sectionProperties.docLayer);
var docLayer = this.sectionProperties.docLayer;
var tileRanges = ctx.paneBoundsList.map(docLayer._pxBoundsToTileRange, docLayer);
for (var rangeIdx = 0; rangeIdx < tileRanges.length; ++rangeIdx) {
var tileRange = tileRanges[rangeIdx];
for (var j = tileRange.min.y; j <= tileRange.max.y; ++j) {
@ -210,7 +210,8 @@ class TilesSection {
var key = coords.key();
var tile = this.sectionProperties.docLayer._tiles[key];
if (tile && tile.loaded) {
// Ensure tile is loaded and is within document bounds.
if (tile && tile.loaded && docLayer._isValidTile(coords)) {
this.paint(tile, ctx, false /* async? */);
}
}