Skip to main content

LaidOutScene

Struct LaidOutScene 

Source
pub struct LaidOutScene<L: StoreLayoutEngine = TaffyStoreLayout> { /* private fields */ }
Expand description

One surface’s laid-out view of a NodeStore.

Holds zero copies of the tree: every query reads &NodeStore plus the engine’s rects.

Implementations§

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn close_request_target(&self) -> Option<NodeId>

The overlay an unconsumed close request closes (see the module docs). O(open overlays).

Source

pub fn dispatch_routing_close_request( &self, events: ValidatedEvents<'_>, batch: &mut EventBatchBuf, dispatch: impl FnMut(ValidatedEvents<'_>) -> DispatchResult, ) -> bool

Dispatches events through dispatch, cut after every close key (a batch without one is one dispatch); when a part reports a close request, its close key is unconsumed. Then runs CloseRequestAction on the last unconsumed close key and dispatches its close through dispatch too (that dispatch’s own close request is ignored: a close is no close key). One close per call: the scene is not laid out again in between, so a second would hit the same overlay. batch is the host’s reused close batch. Returns whether any dispatch dirtied app state. Zero steady-state allocations.

Source

pub fn try_dispatch_routing_close_request<E>( &self, events: ValidatedEvents<'_>, batch: &mut EventBatchBuf, dispatch: impl FnMut(ValidatedEvents<'_>) -> Result<DispatchResult, E>, ) -> Result<bool, E>

Self::dispatch_routing_close_request for a fallible dispatch (e.g. a sandboxed plugin slot): the first error aborts and is returned.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn commit_frame( &mut self, store: &NodeStore, changes: &ChangeSet, ) -> CommitOutcome

Applies one committed ChangeSet (empty on clean ticks): the only commit entry point.

Source

pub fn commit_frame_with<H: CommitHooks<L>>( &mut self, store: &NodeStore, changes: &ChangeSet, hooks: &mut H, ) -> CommitOutcome

Self::commit_frame with backend hooks (animated transforms, frame hooks).

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn record_input_modality(&mut self, modality: FocusModality)

Records the most recent user-initiated input modality (Pointer or Keyboard), driving :focus-visible for subsequent programmatic focus transitions.

Source

pub fn take_focus_transition( &mut self, ) -> Option<(Option<NodeId>, Option<NodeId>, bool)>

Drains the focus transition produced by the most recent post-commit focus reconciliation: (previous_focused, next_focused, focus_visible).

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn set_focus_traversal_policy( &mut self, policy: Box<dyn FocusTraversalPolicy>, )

Installs a custom FocusTraversalPolicy on this scene (replacing TabOrderPolicy).

Source

pub fn traverse_focus( &mut self, store: &NodeStore, current: Option<NodeId>, direction: FocusMove, flags: FocusTraverseFlags, ) -> FocusTraversalOutcome

Computes the next focus target in direction from current under the installed FocusTraversalPolicy, optionally scrolling the resolved target into view.

Zero heap allocations once the scene’s internal scratch buffers are warm.

Source

pub fn last_focus_scroll_dirty(&self) -> &[NodeId]

Scroll containers adjusted during the most recent Self::traverse_focus call when FocusTraverseFlags::SCROLL_INTO_VIEW was requested.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn compute_sticky_delta(&self, store: &NodeStore, id: NodeId) -> (f32, f32)

Computes sticky offset (dx, dy) for id against its nearest scroll ancestor.

Source

pub fn effective_transform( &self, store: &NodeStore, id: NodeId, ) -> Option<Transform2D>

Reads the Transform2D of id from NodeStore’s Transform table (including active StateRules overrides), if id generates a box.

Source

pub fn is_event_target(store: &NodeStore, id: NodeId) -> bool

Returns true when id subscribes to any UI event via its Interaction table.

Source

pub fn hit_test_paragraph_leaf( &self, store: &NodeStore, para_id: NodeId, local_x: f32, local_y: f32, ) -> Option<NodeId>

Directly hit-tests local coordinates (local_x, local_y) inside paragraph root para_id’s content box, returning the hit run’s leaf NodeId (None on trailing whitespace / miss).

Source

pub fn is_scroll_container(store: &NodeStore, id: NodeId) -> bool

Returns true when id is a scroll container (it owns a Scroll row, which also carries its ScrollEvent listeners).

Source

pub fn hit_test(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>

Hit-tests (x, y) in reverse CSS 2.1 Appendix E paint order for the deepest node subscribing to events.

Source

pub fn hit_test_painted( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>

The deepest painted node at (x, y), unfiltered: the press hit of super::top_layer_press.

Source

pub fn hit_test_scroll_container( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>

Hit-tests (x, y) in reverse CSS 2.1 Appendix E paint order for the deepest scroll container (Scroll row).

Source

pub fn hit_test_where( &self, store: &NodeStore, x: f32, y: f32, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>

Hit-tests (x, y) in reverse CSS 2.1 Appendix E paint order for the deepest node accepts admits (O(1) cached StackingPlan, 0 steady-state heap allocations).

Source

pub fn hit_test_with_plan( &self, store: &NodeStore, plan: &StackingPlan, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>

Hit-tests (x, y) using a caller-supplied pre-built StackingPlan (such as SkiaBackend’s retained CompositorScene::stacking), guaranteeing exact 1:1 paint/hit parity at O(1) zero rebuild cost and 0 heap allocations.

Source

pub fn hit_test_with_plan_and_fg( &self, store: &NodeStore, plan: &StackingPlan, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, has_plugin_fg: impl Fn(NodeId) -> bool, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>

Like Self::hit_test_with_plan, also accepting a predicate reporting backend-specific Step 7 foreground content (such as registered plugin tables) painted above NegSc children.

Source

pub fn hit_test_where_with_transform( &self, store: &NodeStore, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>

Hit-tests (x, y) allowing backends to supply an animated Transform2D override per node while reusing the cached zero-alloc StackingPlan and detecting live identity <-> non-identity animated transform transitions even without a store commit.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn interaction_tracker(&self) -> &InteractionTracker

Source

pub fn interaction_epoch(&self) -> u64

Bumped on every pseudo-state change (pointer, focus, disabled, capture): state-rule results may differ since a caller last saw another value.

Source

pub fn responsive_epoch(&self) -> u64

The engine’s StoreLayoutEngine::responsive_epoch: @media / @container results may differ since a caller last saw another value.

Source

pub fn interaction_tracker_mut(&mut self) -> &mut InteractionTracker

Source

pub fn interaction_state(&self, node_id: NodeId) -> InteractionState

Source

pub fn is_subtree_disabled(&self, store: &NodeStore, id: NodeId) -> bool

Returns true when id or any ancestor up to root is disabled (via Interaction::disabled or InteractionTracker::is_disabled).

Source

pub fn set_node_disabled(&mut self, id: NodeId, disabled: bool) -> &[NodeId]

Marks id disabled or enabled in the InteractionTracker (dropping :active, focus and every pointer capture on it), returning the dirty NodeIds.

Source

pub fn is_interaction_target(&self, store: &NodeStore, id: NodeId) -> bool

Returns true when id participates in pointer hover/active/cursor hit-testing.

Source

pub fn is_drop_target(store: &NodeStore, id: NodeId) -> bool

Returns true when id is an active drop target (DragDrop::accept != EMPTY).

Source

pub fn is_draggable_target(store: &NodeStore, id: NodeId) -> bool

Returns true when id is a live visible draggable source (DragDrop::draggable == true).

Source

pub fn hit_test_interaction( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>

Hit-tests (x, y) in reverse paint order for the deepest interaction-eligible node.

Source

pub fn hit_test_drop_zone( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>

Hit-tests (x, y) in reverse paint order for the deepest drop-zone target.

Source

pub fn hit_test_draggable( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>

Hit-tests (x, y) in reverse paint order for the deepest draggable source node.

Source

pub fn visit_effective_patches<'a>( &self, store: &'a NodeStore, id: NodeId, f: impl FnMut(RowPatchView<'a>), )

Visits every RowPatchView overriding id’s base style in cascade order: matching @media, then @container rules (committed layout env), then state rules matching its current InteractionState (zero allocations up to 16 rules).

Source

pub fn is_displayed(&self, store: &NodeStore, id: NodeId) -> bool

Whether id is live and its cascaded display is not none.

Source

pub fn style_cascade(&self) -> StyleCascade<'_, L>

The scene’s single base -> @media -> @container -> state style cascade.

Source

pub fn effective_visual(&self, store: &NodeStore, id: NodeId) -> VisualSnapshot

Resolves the effective VisualSnapshot for id with responsive and pseudo-state rules applied.

Source

pub fn effective_layout_and_visual( &self, store: &NodeStore, id: NodeId, ) -> (LayoutSnapshot, VisualSnapshot)

Resolves both LayoutSnapshot and VisualSnapshot for id with responsive and pseudo-state rules applied.

Source

pub fn effective_background_fill_res( &self, store: &NodeStore, id: NodeId, ) -> Option<ResourceId>

Resolves the effective BackgroundFillRes resource id for id, respecting responsive and state-rule patches (including solid background overrides clearing a base gradient).

Source

pub fn resolve_text_style_fields( &self, store: &NodeStore, id: NodeId, style: &VisualSnapshot, parent_text: Option<(u16, TextAlign, Rgba, f32)>, color_hooked: bool, ) -> (u16, TextAlign, Rgba, f32)

Resolves inherited (font_weight, text_align, text_color, font_size) for id using branchless ResolvedRow<Typography> over parent_text, layered with responsive/state patches and an optional animated text color override.

Source

pub fn effective_cursor(&self, store: &NodeStore, id: NodeId) -> CursorKind

Resolves the effective CursorKind for id in a single O(depth) leaf-to-root walk, converting Pointer to NotAllowed whenever id or any ancestor is disabled.

Source

pub fn current_cursor(&self, store: &NodeStore) -> CursorKind

Resolves the active cursor in O(depth): checks captured node first, then the deepest live hovered node, then the deepest live active node, falling back to CursorKind::Default.

Source

pub fn pointer_move_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> InteractionChange<'_>

Moves the mouse (PointerKey::MOUSE) to target directly, bypassing hit testing and event synthesis (pseudo-state drivers: benches, inspectors). Hosts route samples through Self::resolve_pointer.

Source

pub fn pointer_down_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> InteractionChange<'_>

Presses the mouse’s primary button on target directly (see Self::pointer_move_in_store).

Source

pub fn pointer_up_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> (Option<NodeId>, InteractionChange<'_>)

Releases the mouse over target directly, returning (clicked_node, change) (see Self::pointer_move_in_store).

Source

pub fn pointer_leave_in_store( &mut self, store: &NodeStore, ) -> InteractionChange<'_>

The pointer left the surface: clears :hover (an uncaptured press also drops :active).

Source

pub fn pointer_cancel_in_store( &mut self, store: &NodeStore, ) -> InteractionChange<'_>

Cancels every pointer (window blur): ends every pointer and its capture and clears :hover, :active and :drag-over.

Source

pub fn set_drag_over_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> InteractionChange<'_>

Zero-alloc :drag-over ancestor-chain update against store, syncing inline paragraphs.

Source

pub fn clear_active_in_store( &mut self, store: &NodeStore, ) -> InteractionChange<'_>

Zero-alloc :active press clear against store (used on drag activation).

Source

pub fn set_focus_in_store( &mut self, store: &NodeStore, node_id: Option<NodeId>, modality: FocusModality, ) -> InteractionChange<'_>

Zero-alloc focus update against store, syncing any affected inline paragraphs and capturing the focus anchor for deterministic post-commit unmount recovery.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn overlay_contains_point( &self, store: &NodeStore, ro: ResolvedOverlay, x: f32, y: f32, ) -> bool

Returns true when viewport-space (x, y) lies inside the transform-aware visual box of open top-layer overlay ro.

Source

pub fn overlay_contains_point_with_transform( &self, store: &NodeStore, ro: ResolvedOverlay, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, ) -> bool

Like Self::overlay_contains_point, resolving live animated transforms through resolve_transform (e.g., SkiaBackend’s MotionDriver).

Source

pub fn visual_rect_of( &self, store: &NodeStore, node_id: NodeId, ) -> Option<LayoutRect>

Computes the visual (scroll-shifted, sticky-clamped, Transform2D-mapped, top-layer-adjusted) bounding rectangle of node_id in logical viewport coordinates.

Source

pub fn visual_rect_of_with_transform( &self, store: &NodeStore, node_id: NodeId, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, ) -> Option<LayoutRect>

Like Self::visual_rect_of, allowing backends with live animated transforms (such as SkiaBackend’s MotionDriver) to supply the effective Transform2D per node.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn open_overlays(&self) -> &[ResolvedOverlay]

Open top-layer overlays in deterministic document paint order.

Source

pub fn resolved_overlay(&self, id: NodeId) -> Option<ResolvedOverlay>

Reconciled top-layer geometry for id if it is currently an open Overlay.

Source

pub fn overlay_reconcile_count(&self) -> u64

Monotonic count of completed full overlay reconcile passes.

Source

pub fn any_overlay_anchor_affected( &self, store: &NodeStore, dirty_nodes: &[NodeId], ) -> bool

Returns true iff any open anchored overlay’s resolved anchor (or one of its DOM ancestors) is present in dirty_nodes. O(1) false when no anchored overlays are open (e.g., no overlays or only unanchored modals).

Source

pub fn reconcile_overlays_with_transform( &mut self, store: &NodeStore, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, )

Reconciles viewport-space top-layer coordinates for every hoisted overlay root of the layout engine’s crate::TopLayerIndex, in its document paint order (O(1) fast-exit when nothing is hoisted; zero heap allocations in steady state). Anchor visual rects are read through resolve_transform so animated anchor transforms reposition anchored overlays in lockstep (backends call this directly after scroll-only frames).

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn pointer_geometry<'a>( &'a self, store: &'a NodeStore, ) -> SceneGeometry<'a, L>

This scene’s pointer geometry for the frame laid out from store.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn apply_pointer( &mut self, store: &NodeStore, ev: &ValidatedEvent<'_>, p: &PointerProbe, out: &mut EventBatchBuf, ) -> PointerResolution

Applies probed raw sample ev to the tracker, appending the targeted events to out.

Source

pub fn request_pointer_capture( &mut self, store: &NodeStore, req: PointerCaptureRequest, ) -> Result<(), CaptureError>

W3C setPointerCapture / releasePointerCapture from the app: sets the pointer’s pending capture (applied before its next sample). Capture needs a connected, enabled target.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn is_capture_target(&self, store: &NodeStore, node: NodeId) -> bool

Whether node may hold pointer capture: connected and not in a disabled subtree.

Source

pub fn set_max_pointers(&mut self, max: usize)

Caps simultaneously tracked pointers (NvGestureSettings::max_pointers).

Source

pub fn top_layer_press_at( &self, store: &NodeStore, painted: Option<NodeId>, contains: impl Fn(ResolvedOverlay) -> bool, ) -> TopLayerPress

The top-layer press decision over the open overlays for press hit painted.

Source

pub fn resolve_pointer( &mut self, store: &NodeStore, ev: &ValidatedEvent<'_>, out: &mut EventBatchBuf, ) -> Option<PointerResolution>

Resolves raw sample ev against the scene’s own hit test, appending the targeted events to out (None when ev is not a raw pointer sample).

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn capture_scroll_anchors(&mut self, store: &NodeStore)

Captures pre-layout scroll anchors for every live scrolled container with Scroll::overflow_anchor == OverflowAnchor::Auto right before compute_layout. O(1) no-op when no container is currently scrolled; 0 steady-state heap allocations.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn apply_scroll_chain( &mut self, store: &NodeStore, start: NodeId, dx: f32, dy: f32, kind: ScrollInputKind, ) -> ScrollChainOutcome

Walks from start up through ancestor Scroll containers to NodeId::ROOT, enforcing Scroll::axes, per-axis OverscrollBehavior::{Auto, Contain, None}, and top-layer containment, and delegating per-axis consumption, overscroll, wheel smoothing, and gesture transitions to the active [ScrollPhysicsEngine] (0 steady-state allocs).

Source

pub fn step_scroll_physics( &mut self, store: &NodeStore, dt_s: f32, ) -> (bool, bool)

Advances all active scroll animations in the installed [ScrollPhysicsEngine] by dt_s seconds with zero steady-state allocations. Returns (still_active, any_visual_changed).

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn scroll_into_view_box_with_transform( &mut self, store: &NodeStore, box_node: NodeId, box_rect: LayoutRect, target_rect: LayoutRect, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, apply_scroll: impl FnMut(&mut Self, NodeId, f32, f32) -> (f32, f32), scrolled_containers: Option<&mut Vec<NodeId>>, ) -> bool

Computes minimal scroll target (next_x, next_y) for each enclosing Scroll ancestor of box_node so target_rect becomes visible, invoking apply_scroll(scroll_id, tx, ty) (which returns the clamped (x, y) actually applied) and resolve_transform for live animated transforms. Returns true if any scroll offset moved.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn scroll_offsets(&self) -> &ScrollOffsets

Source

pub fn last_reconciled_scroll_nodes(&self) -> &[NodeId]

Source

pub fn last_scroll_chain_changed(&self) -> &[NodeId]

Source

pub fn last_scroll_chain_clamped_changed(&self) -> &[NodeId]

Source

pub fn last_physics_visual_changed(&self) -> &[NodeId]

Source

pub fn last_physics_clamped_changed(&self) -> &[NodeId]

Source

pub fn set_scroll_offset_raw(&mut self, id: NodeId, dx: f32, dy: f32)

Source

pub fn scroll_offset(&self, id: NodeId) -> (f32, f32)

Source

pub fn scroll_overscroll(&self, id: NodeId) -> (f32, f32)

Source

pub fn visual_scroll_shift(&self, store: &NodeStore, id: NodeId) -> (f32, f32)

Clamped visual scroll shift (without synthetic overscroll).

Source

pub fn compositor_scroll_shift( &self, store: &NodeStore, id: NodeId, ) -> (f32, f32)

Compositor scroll shift including active rubber-band (overscroll_x, overscroll_y) for custom-drawn surfaces (SkiaBackend), hit-testing, and sticky header tracking.

Source

pub fn set_scroll_physics(&mut self, engine: Box<dyn ScrollPhysicsEngine>)

Replaces this surface’s active ScrollPhysicsEngine.

Source

pub fn scroll_physics(&self) -> &dyn ScrollPhysicsEngine

Source

pub fn scroll_physics_mut(&mut self) -> &mut dyn ScrollPhysicsEngine

Source

pub fn scroll_px_per_line(&self) -> f32

Logical pixels per discrete mouse-wheel line detent reported by the installed engine.

Source

pub fn set_scroll_reduced_motion(&mut self, reduced: bool) -> bool

Updates the reduced-motion preference on the installed ScrollPhysicsEngine. Returns true if any active smooth-wheel animations snapped immediately to their target.

Source

pub fn set_scroll_synthetic_momentum(&mut self, enabled: bool)

Source

pub fn has_active_scroll_physics(&self) -> bool

Source

pub fn scroll_content_size( &self, store: &NodeStore, node_id: NodeId, ) -> Option<(f32, f32)>

Source

pub fn cancel_scroll_physics(&mut self, node_id: NodeId) -> bool

Cancels any active scroll physics/overscroll on node_id. Returns true if the node had non-zero rubber-band overscroll so callers can clear visual overscroll state immediately.

Source

pub fn set_scroll_offset_clamped( &mut self, store: &NodeStore, node_id: NodeId, x: f32, y: f32, ) -> (f32, f32, bool)

Sets node_id’s scroll offset clamped to [0..=content - viewport] per Scroll::axes, cancelling any active scroll physics on node_id. Returns (clamped_x, clamped_y, changed).

Source

pub fn set_scroll_offset_clamped_with_bounds( &mut self, store: &NodeStore, node_id: NodeId, x: f32, y: f32, vw: f32, vh: f32, cw: f32, ch: f32, ) -> (f32, f32, bool)

Self::set_scroll_offset_clamped using pre-cached (viewport_w, viewport_h, content_w, content_h) bounds so retained hosts avoid recomputing content extents on 120 Hz scrolls.

Source

pub fn apply_scroll_delta( &mut self, store: &NodeStore, node_id: NodeId, dx: f32, dy: f32, ) -> (f32, f32, bool)

Applies an incremental scroll delta (dx, dy) clamped against content bounds & Scroll::axes. Returns (clamped_x, clamped_y, changed).

Source

pub fn reconcile_scroll_offsets(&mut self, store: &NodeStore) -> &[NodeId]

Prunes removed/detached scroll nodes, honors exact Scroll::requested_scroll_seq transitions (seq != 0 && seq != prev_seq), applies Layer-1 scroll anchor compensation, reconciles active physics entries across mid-fling commits, and re-clamps offsets per Scroll::axes in O(scroll_containers) time with zero steady-state allocations.

Source§

impl<L: StoreLayoutEngine> LaidOutScene<L>

Source

pub fn new(layout: L) -> Self

Wraps layout, installing the deterministic HeuristicTextMeasurer.

Source

pub fn with_text_measurer( layout: L, text_measurer: Arc<dyn TextMeasurer>, ) -> Self

Wraps layout and installs text_measurer into it.

Source

pub fn layout_engine_name(&self) -> &'static str

Source

pub fn layout_engine(&self) -> &L

Source

pub fn layout_engine_mut(&mut self) -> &mut L

Source

pub fn viewport(&self) -> Viewport

Source

pub fn set_viewport(&mut self, viewport: Viewport) -> bool

Sets the viewport; returns true when it changed (the next pass re-runs layout).

Source

pub fn set_media_env(&mut self, env: MediaEnv) -> bool

Sets the @media environment (color scheme, reduced motion, pointer; the viewport size comes from Self::set_viewport). Returns true when it changed (the next pass re-resolves @media / @container rules).

Source

pub fn text_measurer(&self) -> &Arc<dyn TextMeasurer> ⓘ

Source

pub fn set_text_measurer(&mut self, measurer: Arc<dyn TextMeasurer>)

Source

pub fn swap_layout_engine<L2: StoreLayoutEngine>( self, next: L2, ) -> LaidOutScene<L2>

Hot-swaps the layout engine, keeping viewport, text measurer, scroll, and interaction state. Resolved overlays belong to the old engine’s top-layer index and are dropped; follow with Self::commit_frame (empty or full ChangeSet) to lay out and re-resolve them.

Source

pub fn last_layout_ran(&self) -> bool

Whether the most recent Self::recompute_layout / commit actually ran a layout pass.

Source

pub fn replace_layout_engine(&mut self, next: L)

Replaces the layout engine in-place when keeping the same engine type L (e.g., DynLayoutEngine), avoiding any intermediate allocation.

Source

pub fn layout_of(&self, id: NodeId) -> Option<LayoutRect>

Absolute (surface-space) rect of id from the latest layout pass.

Source

pub fn changed_rects(&self) -> Option<&[NodeId]>

Exact nodes whose committed absolute layout rect changed during the latest layout pass (or the union across both layout passes of a focus-recovery commit), or None when callers must fall back to scanning all live nodes (e.g. dead root or an engine without incremental rect tracking).

Source

pub fn paragraphs(&self) -> Option<&ParagraphStore>

Borrowed compiled ParagraphStore from the active layout engine.

Source

pub fn paragraphs_mut(&mut self) -> Option<&mut ParagraphStore>

Mutable borrow of the compiled ParagraphStore from the active layout engine.

Source

pub fn top_layer(&self) -> &TopLayerIndex

The layout engine’s TopLayerIndex: which overlay roots are hoisted, in paint order.

Source

pub fn topmost_modal(&self) -> Option<NodeId>

The topmost (last painted) resolved modal overlay: what hit-testing blocks below and what accessibility (A11yGeometryProvider::topmost_modal) emits from.

Source

pub fn is_inert_under_modal(&self, store: &NodeStore, id: NodeId) -> bool

true when a modal is open and id is neither inside the topmost modal’s subtree nor inside a top-layer overlay painted above it. The one modal-inertness rule shared by scroll chaining, hit-testing, focus, and accessibility (all read resolved overlays).

Source

pub fn recompute_layout(&mut self, store: &NodeStore) -> bool

Runs the engine’s self-gated layout pass for the store root at the current viewport (state-rule re-layouts between commits; commits go through Self::commit_frame).

Source

pub fn measure_root( &mut self, store: &NodeStore, constraints: SizeConstraints, ideal: bool, ) -> SurfaceMeasure

Pure sizing pass over the store root without mutating committed layout boxes or rects.

Source

pub fn reset(&mut self)

Clears layout, interaction, scroll, and overlay state (keeps viewport and text measurer).

Source

pub fn hit_scratch_stats(&self) -> (usize, usize)

Current length and high-water capacity of the reusable stacking-plan item buffer.

Trait Implementations§

Source§

impl Default for LaidOutScene<TaffyStoreLayout>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<L: StoreLayoutEngine> PointerHitTest for LaidOutScene<L>

Source§

fn hit_interaction(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>

The deepest interaction target at (x, y) (falling back to any event target).
Source§

fn hit_painted(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>

The deepest painted node at (x, y), unfiltered (the top-layer press hit).
Source§

fn overlay_contains( &self, store: &NodeStore, ro: ResolvedOverlay, x: f32, y: f32, ) -> bool

Whether (x, y) lies inside the (transform-aware) box of open overlay ro.

Auto Trait Implementations§

§

impl<L = TaffyStoreLayout> !Freeze for LaidOutScene<L>

§

impl<L = TaffyStoreLayout> !RefUnwindSafe for LaidOutScene<L>

§

impl<L = TaffyStoreLayout> !Sync for LaidOutScene<L>

§

impl<L = TaffyStoreLayout> !UnwindSafe for LaidOutScene<L>

§

impl<L> Forget for LaidOutScene<L>

§

impl<L> Move for LaidOutScene<L>

§

impl<L> Send for LaidOutScene<L>
where Arc<dyn TextMeasurer>: Send, RawVecInner: Send, RawTable<(NodeId, ())>: Send, RawTable<(NodeId, (f32, f32))>: Send, BoxRaw<dyn ScrollPhysicsEngine>: Send, RawTable<(u64, NodeId)>: Send, Cell<StackingPlan>: Send, Cell<StackingCacheKey>: Send, Cell<bool>: Send, BoxRaw<dyn FocusTraversalPolicy>: Send,

§

impl<L> Unpin for LaidOutScene<L>

§

impl<L> UnsafeUnpin for LaidOutScene<L>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.