Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

62 bug selecting cells moving offscreen #63

Merged
merged 2 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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