Skip to main content

offer

Function offer 

pub fn offer<T>(
    owner: &T,
    viewport: Rect,
    delta: Vec2,
    overlays: Vec<Rect>,
    transform: Affine,
) -> bool
where T: ?Sized,
Expand description

From a scroller’s collect_damage: offer to have its host copy what of its content stays on screen. viewport is where the content paints, delta how far it moved on screen since the frame the host last presented, and overlays what the scroller paints over its content that does not move with it, all in logical pixels; transform is the one its content landed on screen with this frame (on_screen). The scroller must still damage whatever inside its content changed besides moving.

Returns false when the host does not copy: the scroller then damages its viewport as it would without copies.