Skip to content

Commit

Permalink
fix multi cursor offscreen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkircos committed May 23, 2022
1 parent 91ac45d commit 54e8c12
Showing 1 changed file with 9 additions and 7 deletions.
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 54e8c12

Please sign in to comment.