pub struct Presentation {
pub pin_accents: PinAccents,
pub text_extents: TextExtents,
pub routes: RouteGeometries,
routes_stamp: Option<DocStamp>,
previewed: HashSet<RouteId>,
previewed_in: Option<BlockPath>,
}Fields§
§pin_accents: PinAccents§text_extents: TextExtents§routes: RouteGeometriesA missing entry is a route that has not been reconstructed — nothing to draw or hit-test yet.
routes_stamp: Option<DocStamp>The document value Self::routes was reconstructed from.
previewed: HashSet<RouteId>Wires a preview drew geometry for that the document does not hold. The next borrow re-derives exactly these, and no others.
previewed_in: Option<BlockPath>The scope those previews happened in, since taking them back means reconstructing them where they live.
Implementations§
Source§impl Presentation
impl Presentation
Sourcepub(crate) fn keep_routes(&mut self, live: impl Fn(RouteId) -> bool)
pub(crate) fn keep_routes(&mut self, live: impl Fn(RouteId) -> bool)
Forget the geometry of every wire live does not hold: a deleted
wire has none.
Sourcepub fn refresh_accents(&mut self, indexed: &IndexedDocument<'_>)
pub fn refresh_accents(&mut self, indexed: &IndexedDocument<'_>)
Bring the accent propagation up to date with the document behind
indexed. Gated on the document’s stamp, so the once-per-borrow
call sites stay cheap.
Sourcepub fn refresh_routes(&mut self, indexed: &IndexedDocument<'_>)
pub fn refresh_routes(&mut self, indexed: &IndexedDocument<'_>)
Rebuild every scope’s wire geometry from the authored waypoints
behind indexed. Gated on the document’s stamp like
Self::refresh_accents, so a borrow that changed nothing costs a
comparison — and a commit that landed anywhere, local or foreign,
re-derives the wires without anyone asking.
The stamp is claimed before the pass runs: the reconstruction builds
its own scoped Drawings, whose
constructor calls back in here.
Sourcefn take_previews_back(&mut self, indexed: &IndexedDocument<'_>)
fn take_previews_back(&mut self, indexed: &IndexedDocument<'_>)
Re-derive the wires a preview drew for, and only those. The document never moved — a preview supposes, it does not write — so every other wire is already showing what the document implies.
Sourcepub fn reconstruct_within(
&mut self,
indexed: &IndexedDocument<'_>,
path: &BlockPath,
disturbed: Rect,
)
pub fn reconstruct_within( &mut self, indexed: &IndexedDocument<'_>, path: &BlockPath, disturbed: Rect, )
Bring the wires disturbed reaches up to date against indexed, and
claim its stamp — what a commit does when it knows what it touched.
The gate in Self::refresh_routes is all-or-nothing: a moved stamp
re-derives every wire in the document. That is right for an open, an
undo or a commit from elsewhere, and wrong for a nudge, which knows the
rectangle it disturbed and leaves 7,549 wires drawn exactly as they
were.
Correctness rests on disturbed covering everything the commit wrote —
the same superset rule the foreground is tested against
(a_move_writes_nothing_outside_the_foreground).
Sourcepub fn scratch(&self, indexed: &IndexedDocument<'_>) -> Self
pub fn scratch(&self, indexed: &IndexedDocument<'_>) -> Self
A throwaway presentation for a solve against a document that does not exist yet: the geometry the editor is showing, held as already reconstructed so the pass compares against what the user can see rather than re-deriving it. Measurement caches start empty — the solve reads neither.
Sourcepub fn routes_previewed(
&mut self,
routes: impl IntoIterator<Item = RouteId>,
in_scope: &BlockPath,
)
pub fn routes_previewed( &mut self, routes: impl IntoIterator<Item = RouteId>, in_scope: &BlockPath, )
A preview drew geometry the document does not hold for these wires, so the next borrow must take it back. Previews never move the document, hence never its stamp — this is how an abandoned drag’s preview is undone.
Named wire by wire rather than by dropping the stamp: a drag previews a handful and blanking the stamp had the next borrow re-derive the whole document, every frame.
Trait Implementations§
Source§impl Default for Presentation
impl Default for Presentation
Source§fn default() -> Presentation
fn default() -> Presentation
Auto Trait Implementations§
impl Freeze for Presentation
impl RefUnwindSafe for Presentation
impl Send for Presentation
impl Sync for Presentation
impl Unpin for Presentation
impl UnsafeUnpin for Presentation
impl UnwindSafe for Presentation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more