pub struct NodeRenderState {Show 13 fields
pub opacity: f32,
pub background_color: Option<Color>,
pub border_color: Option<Color>,
pub transform: Option<Transform>,
pub scale: f32,
pub opacity_spring: Option<SpringId>,
pub bg_color_springs: Option<[SpringId; 4]>,
pub transform_springs: Option<[SpringId; 4]>,
pub hovered: bool,
pub focused: bool,
pub pressed: bool,
pub motion: Option<ActiveMotion>,
pub css_animation: Option<ActiveCssAnimation>,
}Expand description
Dynamic render state for a single node
Contains all properties that can change without requiring a tree rebuild. These properties are updated by animations or state machines.
Fields§
§opacity: f32Current opacity (0.0 - 1.0)
background_color: Option<Color>Current background color (animated)
border_color: Option<Color>Current border color (animated)
transform: Option<Transform>Current transform (animated)
scale: f32Current scale (animated, applied to transform)
opacity_spring: Option<SpringId>Spring ID for opacity animation
bg_color_springs: Option<[SpringId; 4]>Spring IDs for color animation (r, g, b, a)
transform_springs: Option<[SpringId; 4]>Spring IDs for transform (translate_x, translate_y, scale, rotate)
hovered: boolWhether this node is currently hovered
focused: boolWhether this node is currently focused
pressed: boolWhether this node is currently pressed
motion: Option<ActiveMotion>Active motion animation (enter/exit) for this node
css_animation: Option<ActiveCssAnimation>Active CSS keyframe animation for this node
This is separate from motion because CSS animations can have
multiple keyframes (not just enter/exit) and different lifecycle.
Implementations§
Source§impl NodeRenderState
impl NodeRenderState
Sourcepub fn new() -> NodeRenderState
pub fn new() -> NodeRenderState
Create a new node render state with default values
Sourcepub fn is_animating(&self) -> bool
pub fn is_animating(&self) -> bool
Check if any properties are currently animating
Sourcepub fn has_active_motion(&self) -> bool
pub fn has_active_motion(&self) -> bool
Check if this node has an active motion animation
Sourcepub fn start_css_animation(&mut self, animation: MultiKeyframeAnimation)
pub fn start_css_animation(&mut self, animation: MultiKeyframeAnimation)
Start a CSS keyframe animation for this node
Replaces any existing CSS animation.
Sourcepub fn has_active_css_animation(&self) -> bool
pub fn has_active_css_animation(&self) -> bool
Check if this node has an active CSS animation
Sourcepub fn tick_css_animation(&mut self, dt_ms: f32) -> Option<&KeyframeProperties>
pub fn tick_css_animation(&mut self, dt_ms: f32) -> Option<&KeyframeProperties>
Tick the CSS animation and get current properties
Returns Some with current properties if animation is active, None otherwise.
Sourcepub fn stop_css_animation(&mut self)
pub fn stop_css_animation(&mut self)
Stop and remove the CSS animation
Sourcepub fn css_animation_properties(&self) -> Option<&KeyframeProperties>
pub fn css_animation_properties(&self) -> Option<&KeyframeProperties>
Get the current CSS animation properties (if any)
Trait Implementations§
Source§impl Clone for NodeRenderState
impl Clone for NodeRenderState
Source§fn clone(&self) -> NodeRenderState
fn clone(&self) -> NodeRenderState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NodeRenderState
impl Debug for NodeRenderState
Source§impl Default for NodeRenderState
impl Default for NodeRenderState
Source§fn default() -> NodeRenderState
fn default() -> NodeRenderState
Auto Trait Implementations§
impl Freeze for NodeRenderState
impl RefUnwindSafe for NodeRenderState
impl Send for NodeRenderState
impl Sync for NodeRenderState
impl Unpin for NodeRenderState
impl UnsafeUnpin for NodeRenderState
impl UnwindSafe for NodeRenderState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.