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
Source§fn clone(&self) -> IndicatorItem
fn clone(&self) -> IndicatorItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more