diff options
| author | blasty <blasty@local> | 2026-08-06 16:28:56 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-08-06 16:28:56 +0200 |
| commit | 4408eaf2cb814e927f51cb0632e9845994abae51 (patch) | |
| tree | 8bb1ed65b1587d6913353fcb3a6744013f9f88fa /docs/GRAPH_VIEW.md | |
| parent | graph: the minimap is clickable, and stops swallowing clicks (diff) | |
| download | ida-tui-4408eaf2cb814e927f51cb0632e9845994abae51.tar.gz ida-tui-4408eaf2cb814e927f51cb0632e9845994abae51.tar.xz ida-tui-4408eaf2cb814e927f51cb0632e9845994abae51.zip | |
graph: navigate to blocks, not to coordinates
Clicking the minimap panned to the exact coordinate under the pointer and moved
the cursor only if a block happened to sit there. Since one minimap cell covers
many canvas cells, "there" was almost always padding: you got a jump into empty
space and the cursor stayed behind, so you had to click a block afterwards to
actually go anywhere.
Blocks cover a few percent of a laid-out graph -- 4.6% of an 87-block function,
0.8% of a 424-block one -- and the rest is the space that keeps edges apart. So
coordinates are the wrong thing to navigate by here. The minimap now snaps to
the nearest block and takes the cursor with it, and a drag scrubs from block to
block. Distance is measured with the column halved, because cells are twice as
tall as they are wide and otherwise "nearest" is not what looks nearest.
A drag-pan or ctrl+d/pageup that ends with no block on screen at all now eases
to the nearest one too, since an empty screen leaves nothing to navigate back
by. It only fires when nothing is visible, so a deliberate pan is never fought.
Diffstat (limited to 'docs/GRAPH_VIEW.md')
| -rw-r--r-- | docs/GRAPH_VIEW.md | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/docs/GRAPH_VIEW.md b/docs/GRAPH_VIEW.md index 6bbcf83..afd0f40 100644 --- a/docs/GRAPH_VIEW.md +++ b/docs/GRAPH_VIEW.md @@ -110,9 +110,14 @@ per block). On `main` (87 blocks) that is a 1378×518 canvas down to 545×289. The **minimap** (`m`) is a coarse occupancy grid of the whole graph with the viewport marked, drawn top-right and inset two columns — a `ScrollView` paints its scrollbar over the last column, which otherwise eats the minimap's border. -Clicking it jumps the view to that part of the graph (and lands the cursor on a -block if one is there, so the keyboard carries on from where you pointed); -dragging scrubs. Because it floats over the canvas rather than living in it, +Clicking it **snaps to the nearest block** and takes the cursor with it; +dragging scrubs from block to block. It deliberately does not scroll to the +coordinate you clicked: blocks cover only a few percent of a laid-out graph +(4.6% on an 87-block function, under 1% on a 424-block one) and the rest is the +padding that keeps edges apart, so a coordinate-accurate jump parks you in empty +space with the cursor left behind. For the same reason, a drag-pan or a +`ctrl+d`/`pageup` that ends with **no block on screen at all** eases to the +nearest one — only when nothing is visible, so it never fights a deliberate pan. Because it floats over the canvas rather than living in it, `on_click` has to test the minimap's hit-box **before** translating the click into canvas coordinates — otherwise a click on the overview reads as a click on whatever block happens to lie underneath it. `_minimap_rect()` is the single |
