Trait freya_core::elements::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,
        default_fonts: &[String],
        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,
    ) -> Area { ... }
    fn drawing_area_with_viewports(
        &self,
        layout_node: &LayoutNode,
        node_ref: &DioxusNode<'_>,
        layout: &Torin<NodeId>,
        scale_factor: f32,
    ) -> Option<Area> { ... }
    fn drawing_area(
        &self,
        layout_node: &LayoutNode,
        node_ref: &DioxusNode<'_>,
        scale_factor: f32,
    ) -> Area { ... }
    fn element_needs_cached_area(&self, _node_ref: &DioxusNode<'_>) -> bool { ... }
    fn needs_cached_area(&self, node_ref: &DioxusNode<'_>) -> bool { ... }
}

Required Methods§

source

fn render( self, layout_node: &LayoutNode, node_ref: &DioxusNode<'_>, canvas: &Canvas, font_collection: &mut FontCollection, font_manager: &FontMgr, default_fonts: &[String], 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, ) -> Area

source

fn drawing_area_with_viewports( &self, layout_node: &LayoutNode, node_ref: &DioxusNode<'_>, layout: &Torin<NodeId>, scale_factor: f32, ) -> Option<Area>

source

fn drawing_area( &self, layout_node: &LayoutNode, node_ref: &DioxusNode<'_>, scale_factor: f32, ) -> Area

Measure the area for this element considering other factors like shadows or borders, which are not part of the layout.

source

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

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

source

fn needs_cached_area(&self, node_ref: &DioxusNode<'_>) -> bool

Implementors§