Skip to main content

dispatch_in

Function dispatch_in 

Source
pub fn dispatch_in(
    events: &[InputEvent],
    layout: &Layout,
    window_size: (u32, u32),
    snapshot: &ParamSnapshot<'_>,
    state: &mut InteractionState,
) -> Vec<ParamEdit>
Expand description

Like dispatch but takes explicit window_size in the same coordinate space as the layout - i.e. the size of the surface the layout is being composited onto.

Use this when the layout is a chrome panel overlaid on a larger custom-rendered surface (visualizers, graphs, canvases). It lets dropdown popups and other bounds-aware overlays use the full window rather than being clipped to the layout’s bounding box - otherwise a popup that wouldn’t fit below the button flips above it even when there’s room below in the outer window.