Skip to content

Commit

Permalink
Merge pull request #63 from quadratichq/62-bug-selecting-cells-moving…
Browse files Browse the repository at this point in the history
…-offscreen

62 bug selecting cells moving offscreen
  • Loading branch information
davidkircos committed May 23, 2022
2 parents eab768b + 54e8c12 commit 7018a7e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/examples/monte_carlo_simulation.grid

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/examples/startup_portfolio.grid

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions src/core/gridGL/interaction/ViewportEventRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ export const ViewportEventRegister = (props: { viewport: Viewport }) => {

// When the cursor moves ensure it is visible
useEffect(() => {
viewport.ensureVisible(
interactionState.cursorPosition.x * CELL_WIDTH,
interactionState.cursorPosition.y * CELL_HEIGHT - 40,
CELL_WIDTH,
CELL_HEIGHT * 4,
false
);
// When multiCursor is visible don't force the single cursor to be visible
if (!interactionState.showMultiCursor)
viewport.ensureVisible(
interactionState.cursorPosition.x * CELL_WIDTH,
interactionState.cursorPosition.y * CELL_HEIGHT - 40,
CELL_WIDTH,
CELL_HEIGHT * 4,
false
);
}, [viewport, interactionState]);

// register zooming event listener to set Atom state
Expand Down

0 comments on commit 7018a7e

Please sign in to comment.