pub enum DrawCmd {
Rect(DrawRect),
RRect(DrawRRect),
Border(DrawBorder),
BoxShadow(DrawBoxShadow),
RingProgress(DrawRingProgress),
Polyline(DrawPolyline),
Text(DrawText),
Image(DrawImage),
}Expand description
Single paint primitive emitted during the paint phase.
Commands retain their data and are executed later by a renderer. The enum does not validate geometry, clamp colors, or guarantee backend support.
§Examples
use ailloli_ui_core::{Color, Rect};
use ailloli_ui_runtime::scene::{DrawCmd, DrawRect};
let cmd = DrawCmd::Rect(DrawRect { rect: Rect::new(0.0, 0.0, 8.0, 8.0), color: Color::WHITE });
assert!(matches!(cmd, DrawCmd::Rect(_)));Variants§
Rect(DrawRect)
Solid rectangle.
RRect(DrawRRect)
Rounded rectangle.
Border(DrawBorder)
Layout-aware box border.
BoxShadow(DrawBoxShadow)
Paint-only box shadow.
RingProgress(DrawRingProgress)
Circular progress ring with a complete track and fractional fill.
Polyline(DrawPolyline)
Stroked polyline.
Text(DrawText)
Shaped text at a baseline position.
Image(DrawImage)
Icon or image in a rect.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DrawCmd
impl !RefUnwindSafe for DrawCmd
impl Send for DrawCmd
impl Sync for DrawCmd
impl Unpin for DrawCmd
impl !UnwindSafe for DrawCmd
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.