Skip to main content

reconstruct_scope

Function reconstruct_scope 

Source
pub(crate) fn reconstruct_scope(
    indexed: &IndexedDocument<'_>,
    presentation: &mut Presentation,
    path: &BlockPath,
    reconstructing: Reconstructing<'_>,
)
Expand description

Prepare the whole document to be looked at: turn what the document authors into what the canvas shows.

A route’s full path is stored as its corner waypoints, never as solved edge geometry, so every scope’s wires are reconstructed from those corners — straight legs drawn directly, only genuinely blocked/non-colinear legs routed (see Drawing::reconstruct_routes). A clean document is rebuilt with zero pathfinding, so persisted and hand-adjusted geometry survives unchanged. This runs for all scopes, not just the current view: navigation does not re-reconstruct, and a foreign commit can land anywhere.

Read-only — the sink it opens is local and discarded, because preparing a document to be looked at has nothing to author. Call it through Presentation::refresh_routes, which owns the stamp gate. Reconstruct one scope’s wires, and only the ones reconstructing names — what a commit that knows what it disturbed needs, and what a preview’s next borrow needs to take its supposition back. present_document is what an open or a foreign commit needs, which is everything.