Skip to content

Commit 7018a7e

Browse files
authored
Merge pull request #63 from quadratichq/62-bug-selecting-cells-moving-offscreen
62 bug selecting cells moving offscreen
2 parents eab768b + 54e8c12 commit 7018a7e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

docs/examples/monte_carlo_simulation.grid

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

docs/examples/startup_portfolio.grid

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

src/core/gridGL/interaction/ViewportEventRegister.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ export const ViewportEventRegister = (props: { viewport: Viewport }) => {
1717

1818
// When the cursor moves ensure it is visible
1919
useEffect(() => {
20-
viewport.ensureVisible(
21-
interactionState.cursorPosition.x * CELL_WIDTH,
22-
interactionState.cursorPosition.y * CELL_HEIGHT - 40,
23-
CELL_WIDTH,
24-
CELL_HEIGHT * 4,
25-
false
26-
);
20+
// When multiCursor is visible don't force the single cursor to be visible
21+
if (!interactionState.showMultiCursor)
22+
viewport.ensureVisible(
23+
interactionState.cursorPosition.x * CELL_WIDTH,
24+
interactionState.cursorPosition.y * CELL_HEIGHT - 40,
25+
CELL_WIDTH,
26+
CELL_HEIGHT * 4,
27+
false
28+
);
2729
}, [viewport, interactionState]);
2830

2931
// register zooming event listener to set Atom state

0 commit comments

Comments
 (0)