Repository navigation
Commit 3319ef4
committed
fix(react): keep minimap bounds at the viewport when all nodes are hidden
The minimap selector only fell back to the viewport rect when nodeLookup was
empty, but the bounds it merges come from a traversal filtered to the visible
nodes. getInternalNodesBounds returns a rect at the origin when nothing passes
that filter, so a flow whose nodes are all hidden merged a phantom rect at
(0, 0) into the viewport rect.
With the viewport panned away from the origin the minimap then zoomed out to
span everything between the origin and the viewport, shrinking the viewport
mask to a speck.
Check for a visible node instead of any node. The behavior is unchanged as
soon as one node is visible, and for an empty flow.1 parent 31fa38e commit 3319ef4
2 files changed
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
27 | 41 | | |
28 | 42 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| |||
0 commit comments