From e103f6b6c2399bf46301c3c6f9f5c4cecd456ef8 Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 6 Aug 2026 16:20:29 +0200 Subject: graph: the minimap is clickable, and stops swallowing clicks Click it to jump the view to that part of the graph, drag to scrub. If the point you clicked is over a block the cursor lands in it, so the keyboard carries on from where you pointed instead of snapping back. This also fixes a real bug rather than only adding a feature. The minimap FLOATS over the canvas -- it is pinned to the viewport, not drawn into the graph -- so a click on it was being translated into canvas coordinates and dropping the cursor into whatever block happened to lie underneath. It has to be hit-tested before the canvas, which is what on_click now does. _minimap_rect() is the one source of truth for where it is: the renderer and the hit-test both take the position from it, so the two-column inset that keeps it clear of the ScrollView's scrollbar can't drift between them. --- docs/GRAPH_VIEW.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/GRAPH_VIEW.md') diff --git a/docs/GRAPH_VIEW.md b/docs/GRAPH_VIEW.md index ccddfe7..6bbcf83 100644 --- a/docs/GRAPH_VIEW.md +++ b/docs/GRAPH_VIEW.md @@ -37,6 +37,7 @@ extra work. | `x` `n` `y` `;` | xrefs / rename / retype / comment, exactly as in the listing | | `Tab` | leave for the pseudocode of the block you're on | | mouse | drag to pan, click to place the cursor, double-click to follow | +| minimap | click to jump the view there, drag to scrub | Graph mode is **sticky**: following a call from the graph lands in the callee's graph rather than dumping you back in the listing. @@ -109,6 +110,13 @@ 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, +`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 +source of truth for both the drawing and the hit-test. ## Limits -- cgit v1.3.1-sl0p