pub struct TickMark {
pub angle: f32,
pub outer_radius: f32,
pub length: f32,
pub width: f32,
pub color: Color,
}Expand description
Static tick mark on the clock face. Each tick is its own
ClockLayer, so a hand sweeping across the face only triggers
repaint of the few ticks it crosses, not the whole face. Geometry is
expressed as fractions of face radius for size-agnostic scaling.
The angle convention matches the hands: 0 is 12 o’clock; angle
increases clockwise.
Fields§
§angle: f32Angle in radians; 0 = 12 o’clock, clockwise.
outer_radius: f32Distance from face center to outer end of the mark, fraction of
face radius. 1.0 = exactly at the face edge.
length: f32Length along the radial direction, fraction of face radius.
width: f32Width perpendicular to the radial direction, fraction of face radius.
color: ColorMark color (alpha modulated by AA coverage at edges).
Trait Implementations§
Source§impl ClockLayer for TickMark
impl ClockLayer for TickMark
Source§fn bbox(&self, _state: &ClockState, bounds: Rect) -> Rect
fn bbox(&self, _state: &ClockState, bounds: Rect) -> Rect
Pixels this layer might write at
state, in absolute framebuffer
coordinates. Used for cross-layer dirty union math.Source§fn dirty(
&self,
prev: Option<&ClockState>,
_state: &ClockState,
bounds: Rect,
) -> Rect
fn dirty( &self, prev: Option<&ClockState>, _state: &ClockState, bounds: Rect, ) -> Rect
Self-induced dirty between
prev and state. An empty rect means
“I have not changed”; the compositor will still call paint if
another layer’s dirty rect intersects this layer’s bbox.Auto Trait Implementations§
impl Freeze for TickMark
impl RefUnwindSafe for TickMark
impl Send for TickMark
impl Sync for TickMark
impl Unpin for TickMark
impl UnsafeUnpin for TickMark
impl UnwindSafe for TickMark
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