Trait freya::core::prelude::ElementUtils
pub trait ElementUtils {
// Required method
fn render(
self,
layout_node: &LayoutNode,
node_ref: &NodeRef<'_, CustomAttributeValues>,
canvas: &Canvas,
font_collection: &mut RCHandle<skia_textlayout_FontCollection>,
font_manager: &RCHandle<SkFontMgr>,
default_fonts: &[String],
scale_factor: f32,
);
// Provided methods
fn is_point_inside_area(
&self,
point: &Point2D<f64, Measure>,
_node_ref: &NodeRef<'_, CustomAttributeValues>,
layout_node: &LayoutNode,
_scale_factor: f32,
) -> bool { ... }
fn clip(
&self,
_layout_node: &LayoutNode,
_node_ref: &NodeRef<'_, CustomAttributeValues>,
_canvas: &Canvas,
_scale_factor: f32,
) { ... }
fn element_drawing_area(
&self,
layout_node: &LayoutNode,
_node_ref: &NodeRef<'_, CustomAttributeValues>,
_scale_factor: f32,
) -> Rect<f32, Measure> { ... }
fn drawing_area_with_viewports(
&self,
layout_node: &LayoutNode,
node_ref: &NodeRef<'_, CustomAttributeValues>,
layout: &Torin<EntityId>,
scale_factor: f32,
) -> Option<Rect<f32, Measure>> { ... }
fn drawing_area(
&self,
layout_node: &LayoutNode,
node_ref: &NodeRef<'_, CustomAttributeValues>,
scale_factor: f32,
) -> Rect<f32, Measure> { ... }
fn element_needs_cached_area(
&self,
_node_ref: &NodeRef<'_, CustomAttributeValues>,
) -> bool { ... }
fn needs_cached_area(
&self,
node_ref: &NodeRef<'_, CustomAttributeValues>,
) -> bool { ... }
}
Required Methods§
fn render( self, layout_node: &LayoutNode, node_ref: &NodeRef<'_, CustomAttributeValues>, canvas: &Canvas, font_collection: &mut RCHandle<skia_textlayout_FontCollection>, font_manager: &RCHandle<SkFontMgr>, default_fonts: &[String], scale_factor: f32, )
Provided Methods§
fn is_point_inside_area( &self, point: &Point2D<f64, Measure>, _node_ref: &NodeRef<'_, CustomAttributeValues>, layout_node: &LayoutNode, _scale_factor: f32, ) -> bool
fn clip( &self, _layout_node: &LayoutNode, _node_ref: &NodeRef<'_, CustomAttributeValues>, _canvas: &Canvas, _scale_factor: f32, )
fn element_drawing_area( &self, layout_node: &LayoutNode, _node_ref: &NodeRef<'_, CustomAttributeValues>, _scale_factor: f32, ) -> Rect<f32, Measure>
fn drawing_area_with_viewports( &self, layout_node: &LayoutNode, node_ref: &NodeRef<'_, CustomAttributeValues>, layout: &Torin<EntityId>, scale_factor: f32, ) -> Option<Rect<f32, Measure>>
fn drawing_area(
&self,
layout_node: &LayoutNode,
node_ref: &NodeRef<'_, CustomAttributeValues>,
scale_factor: f32,
) -> Rect<f32, Measure>
fn drawing_area( &self, layout_node: &LayoutNode, node_ref: &NodeRef<'_, CustomAttributeValues>, scale_factor: f32, ) -> Rect<f32, Measure>
Measure the area for this element considering other factors like shadows or borders, which are not part of the layout.
fn element_needs_cached_area(
&self,
_node_ref: &NodeRef<'_, CustomAttributeValues>,
) -> bool
fn element_needs_cached_area( &self, _node_ref: &NodeRef<'_, CustomAttributeValues>, ) -> 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
.