FIX: Skip cells that have already been computed

This commit is contained in:
Nicolás Hatcher
2025-07-19 09:01:02 +02:00
committed by Nicolás Hatcher Andrés
parent 7193c9bf1b
commit 56abac79ca

View File

@@ -388,13 +388,15 @@ export default class WorksheetCanvas {
topLeftCell: Cell, topLeftCell: Cell,
bottomRightCell: Cell, bottomRightCell: Cell,
): void { ): void {
const frozenColumnsCount = this.model.getFrozenColumnsCount(selectedSheet);
// First compute the text to the left of the viewport // First compute the text to the left of the viewport
const columnToTheLeft = this.model.getLastNonEmptyInRowBeforeColumn( const columnToTheLeft = this.model.getLastNonEmptyInRowBeforeColumn(
selectedSheet, selectedSheet,
row, row,
topLeftCell.column, topLeftCell.column,
); );
if (columnToTheLeft) { // If it is one of the frozen columns it is already computed
if (columnToTheLeft && columnToTheLeft > frozenColumnsCount) {
const columnWidth = this.getColumnWidth(selectedSheet, columnToTheLeft); const columnWidth = this.getColumnWidth(selectedSheet, columnToTheLeft);
const [textX, textY] = this.getCoordinatesByCell(row, columnToTheLeft); const [textX, textY] = this.getCoordinatesByCell(row, columnToTheLeft);
this.computeCellText( this.computeCellText(