Skip to main content

TickMark

Struct TickMark 

Source
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: f32

Angle in radians; 0 = 12 o’clock, clockwise.

§outer_radius: f32

Distance from face center to outer end of the mark, fraction of face radius. 1.0 = exactly at the face edge.

§length: f32

Length along the radial direction, fraction of face radius.

§width: f32

Width perpendicular to the radial direction, fraction of face radius.

§color: Color

Mark color (alpha modulated by AA coverage at edges).

Trait Implementations§

Source§

impl ClockLayer for TickMark

Source§

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

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.
Source§

fn paint(&self, renderer: &mut dyn Renderer, _state: &ClockState, bounds: Rect)

Paint this layer at state. Layers must paint within their declared bbox — the compositor relies on that for dirty-rect correctness.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.