Skip to content

Commit

Permalink
fix(sheets): merge disappear on hide row (#1714)
Browse files Browse the repository at this point in the history
* fix(sheet): merge disappear on hide row

* fix(sheet): ruler update

* docs(sheet): add comment

* chore: fix comment style

---------

Co-authored-by: Wenzhao Hu <wzhudev@gmail.com>
  • Loading branch information
DR-Univer and wzhudev committed Apr 2, 2024
1 parent a8c9452 commit e68d47f
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 5 deletions.
22 changes: 17 additions & 5 deletions packages/engine-render/src/components/sheets/sheet-skeleton.ts
Expand Up @@ -1621,11 +1621,6 @@ export class SpreadsheetSkeleton extends Skeleton {
return true;
}

const hidden = this._worksheet.getColVisible(c) === false || this._worksheet.getRowVisible(r) === false;
if (hidden) {
return true;
}

/**
* TODO: DR-Univer getCellRaw for slide demo, the implementation approach will be changed in the future.
*/
Expand All @@ -1634,6 +1629,23 @@ export class SpreadsheetSkeleton extends Skeleton {
return true;
}

const hidden = this._worksheet.getColVisible(c) === false || this._worksheet.getRowVisible(r) === false;
if (hidden) {
const { isMerged, isMergedMainCell } = getCellInfoInMergeData(
r,
c,
this._dataMergeCache
);

if (isMerged && !isMergedMainCell) {
// If the cell is merged and is not the main cell, the cell is not rendered.
return true;
} else if (!isMergedMainCell) {
// If the cell no merged, the cell is not rendered.
return true;
}
}

const cache = this._stylesCache;

// style supports inline styles
Expand Down

0 comments on commit e68d47f

Please sign in to comment.