Struct pax_core::engine::RenderTreeContext
source · pub struct RenderTreeContext<'a, R: 'static + RenderContext> {
pub engine: &'a PaxEngine<R>,
pub transform_global: Affine,
pub transform_scroller_reset: Affine,
pub bounds: (f64, f64),
pub runtime: Rc<RefCell<Runtime<R>>>,
pub node: RenderNodePtr<R>,
pub parent_repeat_expanded_node: Option<Weak<RepeatExpandedNode<R>>>,
pub timeline_playhead_position: usize,
pub inherited_adoptees: Option<RenderNodePtrList<R>>,
}Fields§
§engine: &'a PaxEngine<R>§transform_global: Affine§transform_scroller_reset: Affine§bounds: (f64, f64)§runtime: Rc<RefCell<Runtime<R>>>§node: RenderNodePtr<R>§parent_repeat_expanded_node: Option<Weak<RepeatExpandedNode<R>>>§timeline_playhead_position: usize§inherited_adoptees: Option<RenderNodePtrList<R>>Implementations§
source§impl<'a, R: 'static + RenderContext> RenderTreeContext<'a, R>
impl<'a, R: 'static + RenderContext> RenderTreeContext<'a, R>
pub fn distill_userland_node_context(&self) -> RuntimeContext
source§impl<'a, R: RenderContext> RenderTreeContext<'a, R>
impl<'a, R: RenderContext> RenderTreeContext<'a, R>
pub fn compute_eased_value<T: Clone + Interpolatable>( &self, transition_manager: Option<&mut TransitionManager<T>> ) -> Option<T>
sourcepub fn get_id_chain(&self, id: u32) -> Vec<u32>
pub fn get_id_chain(&self, id: u32) -> Vec<u32>
Get an id_chain for this element, an array of u64 used collectively as a single unique ID across native bridges.
Specifically, the ID chain represents not only the instance ID, but the indices of each RepeatItem found by a traversal
of the runtime stack.
The need for this emerges from the fact that Repeated elements share a single underlying
instance, where that instantiation happens once at init-time — specifically, it does not happen
when Repeated elements are added and removed to the render tree. 10 apparent rendered elements may share the same instance_id – which doesn’t work as a unique key for native renderers
that are expected to render and update 10 distinct elements.
Thus, the id_chain is used as a unique key, first the instance_id (which will increase monotonically through the lifetime of the program),
then each RepeatItem index through a traversal of the stack frame. Thus, each virtually Repeated element
gets its own unique ID in the form of an “address” through any nested Repeat-ancestors.