pub struct IndicatorItem {
pub index: usize,
pub start_offset: f32,
pub size: f32,
}Expand description
One row of a ScalingLazyColumn, as ScalingLazyListItemInfo reports it.
Device pixels. Wear’s adapter reads a layout that has already been resolved onto the pixel grid — item heights are whole pixels, the viewport’s centre line is an integer halving — and it divides by those integers. Doing the same arithmetic in points quietly loses the halves, and the halves are what decide which item index the thumb’s ends land on.
scaling_list_items builds these from a laid-out list; a caller that
already holds a real ScalingLazyListLayoutInfo can fill them in directly.
Fields§
§index: usizeThe row’s index in the whole list.
start_offset: f32ScalingLazyListItemInfo.startOffset(ItemCenter): the row’s top edge
measured from the viewport’s centre line, after scaling.
size: f32ScalingLazyListItemInfo.size: the row’s height after scaling, rounded
to a whole pixel. Not the height the row is drawn at — the graphics
layer scales by the unrounded scale — but this rounded one is what the
layout info reports and therefore what the indicator divides by.
Trait Implementations§
Source§impl Clone for IndicatorItem
impl Clone for IndicatorItem
impl Copy for IndicatorItem
Source§impl Debug for IndicatorItem
impl Debug for IndicatorItem
Source§impl PartialEq for IndicatorItem
impl PartialEq for IndicatorItem
impl StructuralPartialEq for IndicatorItem
Auto Trait Implementations§
impl Freeze for IndicatorItem
impl RefUnwindSafe for IndicatorItem
impl Send for IndicatorItem
impl Sync for IndicatorItem
impl Unpin for IndicatorItem
impl UnsafeUnpin for IndicatorItem
impl UnwindSafe for IndicatorItem
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more