Skip to content

Commit

Permalink
feat: optimize range select in HeaderHighlightPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Nov 20, 2024
1 parent 319eb35 commit 2809be6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "feat: optimize range select in HeaderHighlightPlugin",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
4 changes: 0 additions & 4 deletions packages/vtable/src/plugins/custom-cell-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ export class CustomCellStylePlugin {
this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
}

if (!customStyleId) {
// remove from customCellStyleArrangement array
this.customCellStyleArrangement.splice(index, 1);
}
this.table.scenegraph.updateNextFrame();
}

Expand Down
6 changes: 6 additions & 0 deletions packages/vtable/src/plugins/header-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export class HeaderHighlightPlugin {
this.table.on('selected_clear', () => {
this.clearHighlight();
});

this.table.on('mousemove_table', () => {
if (this.table.stateManager.select.selecting) {
this.updateHighlight();
}
});
}

clearHighlight() {
Expand Down

0 comments on commit 2809be6

Please sign in to comment.