Skip to content

Commit

Permalink
fix: add corner group clip
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jan 3, 2024
1 parent d36f718 commit 343d3f1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,34 @@ export class ClipBodyGroupBeforeRenderContribution implements IGroupRenderContri
const height = table.getBottomFrozenRowsHeight();
context.beginPath();
context.rect(x, y, width, height);
} else if ((group as Group).role === 'corner-header') {
const x = 0;
const y = 0;
const width = table.getFrozenColsWidth();
const height = table.getFrozenRowsHeight();
context.beginPath();
context.rect(x, y, width, height);
} else if ((group as Group).role === 'corner-right-top-header') {
const x = 0;
const y = 0;
const width = table.getRightFrozenColsWidth();
const height = table.getFrozenRowsHeight();
context.beginPath();
context.rect(x, y, width, height);
} else if ((group as Group).role === 'corner-right-bottom-header') {
const x = 0;
const y = 0;
const width = table.getRightFrozenColsWidth();
const height = table.getBottomFrozenRowsHeight();
context.beginPath();
context.rect(x, y, width, height);
} else if ((group as Group).role === 'corner-left-bottom-header') {
const x = 0;
const y = 0;
const width = table.getFrozenColsWidth();
const height = table.getBottomFrozenRowsHeight();
context.beginPath();
context.rect(x, y, width, height);
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion packages/vtable/src/scenegraph/graphic/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,13 @@ export class Group extends VRenderGroup {
this.role === 'row-header' ||
this.role === 'col-header' ||
this.role === 'right-frozen' ||
this.role === 'bottom-frozen'
this.role === 'bottom-frozen' ||
this.role === 'corner-header' ||
this.role === 'corner-right-top-header' ||
this.role === 'corner-right-bottom-header' ||
this.role === 'corner-left-bottom-header'
) {
// Infinity bounds for manual clip group
this._AABBBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
// 更新bounds之后需要设置父节点,否则tag丢失
this.parent && this.parent.addChildUpdateBoundTag();
Expand Down

0 comments on commit 343d3f1

Please sign in to comment.