diff options
| author | Cliff Click <cliffc@acm.org> | 2026-09-22 14:59:11 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-09-22 14:59:11 -0700 |
| commit | ed13d1ca215ea094b4d6beab89b90ab4c05ed396 (patch) | |
| tree | d273e5508c01566c51b03b322f750f7aeea6e3a5 /graph/web/viewer.js | |
| parent | 29fb671e69f90ad3b04c6fa8d746caf857f89e77 (diff) | |
| download | Simple-ed13d1ca215ea094b4d6beab89b90ab4c05ed396.tar.gz Simple-ed13d1ca215ea094b4d6beab89b90ab4c05ed396.zip | |
Tidy up scope display
Diffstat (limited to 'graph/web/viewer.js')
| -rw-r--r-- | graph/web/viewer.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/graph/web/viewer.js b/graph/web/viewer.js index c36c369c..63ee195e 100644 --- a/graph/web/viewer.js +++ b/graph/web/viewer.js @@ -81,11 +81,17 @@ async function render(index) { const frame = frames[index]; busy = !frame.layout ? "Laying out frame " + (index + 1) + "..." : "Drawing..."; updateUI(); - if (frame.pos >= 0) program.setSelectionRange(frame.pos, frame.pos + 1); try { if (!layout) layout = new GraphLayout(); - if (!frame.layout) frame.layout = await layout.run(frame.snap); - if (generation === frameGeneration) renderer.show(frame.snap, frame.layout, frame.evt); + if (!frame.layout) frame.layout = await layout.run(frame.snap, frame.evt); + if (generation === frameGeneration) { + renderer.show(frame.snap, frame.layout, frame.evt); + if (frame.pos >= 0) { + // Stepping focuses a button; focus the source so its selection is visible. + program.focus({preventScroll: true}); + program.setSelectionRange(frame.pos, frame.pos + 1); + } + } rendering = false; busy = ""; if (generation === frameGeneration) current = index; |
