diff --git a/packages/s2-core/src/interaction/brush-selection/base-brush-selection.ts b/packages/s2-core/src/interaction/brush-selection/base-brush-selection.ts index 64e33c63d7..fb70510a8e 100644 --- a/packages/s2-core/src/interaction/brush-selection/base-brush-selection.ts +++ b/packages/s2-core/src/interaction/brush-selection/base-brush-selection.ts @@ -772,18 +772,18 @@ export class BaseBrushSelection }; public autoBrushScroll(point: PointLike, isRowHeader = false) { - if (this.isPointInCanvas(point)) { - return false; - } - this.clearAutoScroll(); - const deltaX = point?.x - this.endBrushPoint?.x; - const deltaY = point?.y - this.endBrushPoint?.y; + if (!this.isPointInCanvas(point)) { + const deltaX = point?.x - this.endBrushPoint?.x; + const deltaY = point?.y - this.endBrushPoint?.y; - this.handleScroll(deltaX, deltaY, isRowHeader); + this.handleScroll(deltaX, deltaY, isRowHeader); - return true; + return true; + } + + return false; } public emitBrushSelectionEvent(