TranquilMarmot / YarnLoom

Visual Studio Code extension for editing YarnSpinner files
MIT License
18 stars 2 forks source link

After focusing on a node, dragging the viewport around makes it jump #2

Closed TranquilMarmot closed 3 years ago

TranquilMarmot commented 4 years ago

Describe the bug Focusing on a node makes it difficult to move the graph around.

Expected behavior When dragging the graph after focusing on a node, the focused node becomes un-focused and the graph moves smoothly

Actual behavior When dragging the graph after focusing on a node, the graph will jump around.

Steps To Reproduce Steps to reproduce the behavior:

  1. Open the list of nodes
  2. Click on a node to center it in the viewport
  3. Try to drag the viewport around
  4. The viewport will "jump" around, sometimes to the origin (0,0)

Screenshots

bug

Additional context

Currently, un-focusing on the currently focused node is triggered by the onClickGraph event handler passed into the Graph from react-d3-graph. This has an _onDragStart "instance member" that needs to be hooked into here but it looks like that cannot be passed a handler via props.

Environment

TranquilMarmot commented 4 years ago

It looks like this might be fixed when https://github.com/danielcaldas/react-d3-graph/pull/341 is merged