logo
pub trait Renderer: Sized {
    fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self));
    fn with_translation(
        &mut self,
        translation: Vector,
        f: impl FnOnce(&mut Self)
    ); fn clear(&mut self); fn fill_quad(&mut self, quad: Quad, background: impl Into<Background>); fn layout<'a, Message>(
        &mut self,
        element: &Element<'a, Message, Self>,
        limits: &Limits
    ) -> Node { ... } }
Expand description

A component that can be used by widgets to draw themselves on a screen.

Required Methods

Draws the primitives recorded in the given closure in a new layer.

The layer will clip its contents to the provided bounds.

Applies a translation to the primitives recorded in the given closure.

Clears all of the recorded primitives in the Renderer.

Fills a Quad with the provided Background.

Provided Methods

Lays out the elements of a user interface.

You should override this if you need to perform any operations before or after layouting. For instance, trimming the measurements cache.

Implementors