freya_core::elements

Trait ElementUtils

Source
pub trait ElementUtils {
    // Required method
    fn render(
        self,
        layout_node: &LayoutNode,
        node_ref: &DioxusNode<'_>,
        canvas: &Canvas,
        font_collection: &mut FontCollection,
        font_manager: &FontMgr,
        fallback_fonts: &[String],
        images_cache: &mut ImagesCache,
        scale_factor: f32,
    );

    // Provided methods
    fn is_point_inside_area(
        &self,
        point: &CursorPoint,
        _node_ref: &DioxusNode<'_>,
        layout_node: &LayoutNode,
        _scale_factor: f32,
    ) -> bool { ... }
    fn clip(
        &self,
        _layout_node: &LayoutNode,
        _node_ref: &DioxusNode<'_>,
        _canvas: &Canvas,
        _scale_factor: f32,
    ) { ... }
    fn element_drawing_area(
        &self,
        layout_node: &LayoutNode,
        _node_ref: &DioxusNode<'_>,
        _scale_factor: f32,
        _node_style: &StyleState,
    ) -> Area { ... }
    fn element_needs_cached_area(
        &self,
        _node_ref: &DioxusNode<'_>,
        _style_state: &StyleState,
    ) -> bool { ... }
}

Required Methods§

Source

fn render( self, layout_node: &LayoutNode, node_ref: &DioxusNode<'_>, canvas: &Canvas, font_collection: &mut FontCollection, font_manager: &FontMgr, fallback_fonts: &[String], images_cache: &mut ImagesCache, scale_factor: f32, )

Provided Methods§

Source

fn is_point_inside_area( &self, point: &CursorPoint, _node_ref: &DioxusNode<'_>, layout_node: &LayoutNode, _scale_factor: f32, ) -> bool

Source

fn clip( &self, _layout_node: &LayoutNode, _node_ref: &DioxusNode<'_>, _canvas: &Canvas, _scale_factor: f32, )

Source

fn element_drawing_area( &self, layout_node: &LayoutNode, _node_ref: &DioxusNode<'_>, _scale_factor: f32, _node_style: &StyleState, ) -> Area

Source

fn element_needs_cached_area( &self, _node_ref: &DioxusNode<'_>, _style_state: &StyleState, ) -> bool

Check if this element requires any kind of special caching. Mainly used for text-like elements with shadows. See crate::render::CompositorCache. Default to false.

Implementors§