pub struct DrawRingProgress {
pub rect: Rect,
pub thickness: f32,
pub fraction: f32,
pub track_color: Color,
pub fill_color: Color,
pub start_angle: f32,
}Expand description
Circular progress-ring primitive.
Numeric inputs are stored verbatim. The conventional fraction range is
0.0..=1.0, but this type does not clamp it or reject negative/non-finite
thicknesses and angles.
§Examples
use ailloli_ui_core::{Color, Rect};
use ailloli_ui_runtime::scene::DrawRingProgress;
let ring = DrawRingProgress {
rect: Rect::new(0.0, 0.0, 24.0, 24.0), thickness: 2.0, fraction: 0.5,
track_color: Color::BLACK, fill_color: Color::WHITE,
start_angle: -std::f32::consts::FRAC_PI_2,
};
assert_eq!(ring.fraction, 0.5);Fields§
§rect: RectOuter ring rectangle in window-space logical pixels.
thickness: f32Requested stroke thickness in logical pixels.
fraction: f32Requested filled revolution fraction; conventionally 0.0..=1.0.
track_color: ColorLinear-RGBA color of the complete background track.
fill_color: ColorLinear-RGBA color of the fractional foreground arc.
start_angle: f32Radians, with -FRAC_PI_2 meaning top-center start.
Trait Implementations§
Source§impl Clone for DrawRingProgress
impl Clone for DrawRingProgress
Source§fn clone(&self) -> DrawRingProgress
fn clone(&self) -> DrawRingProgress
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DrawRingProgress
impl Debug for DrawRingProgress
Source§impl PartialEq for DrawRingProgress
impl PartialEq for DrawRingProgress
impl Copy for DrawRingProgress
impl StructuralPartialEq for DrawRingProgress
Auto Trait Implementations§
impl Freeze for DrawRingProgress
impl RefUnwindSafe for DrawRingProgress
impl Send for DrawRingProgress
impl Sync for DrawRingProgress
impl Unpin for DrawRingProgress
impl UnwindSafe for DrawRingProgress
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.