pub struct WheelGeometry {
pub diameter_ratio: f32,
pub perspective: f32,
}Expand description
The shape of the cylinder rows are laid on.
Fields§
§diameter_ratio: f32The cylinder’s diameter as a multiple of the viewport’s height. Larger is flatter: at a diameter of twice the viewport only the middle thirty degrees of the cylinder are ever in front of it, and thirty degrees of a turn is a slope rather than a wheel.
perspective: f32How much a row narrows per pixel it has receded. 0.0 leaves every row the full
width, which reads as a fold rather than a turn.
Implementations§
Source§impl WheelGeometry
impl WheelGeometry
Sourcepub fn radius(&self, extent: f32) -> f32
pub fn radius(&self, extent: f32) -> f32
The cylinder’s radius in a viewport extent pixels along.
Sourcepub fn row(&self, extent: f32, flat: f32) -> Option<RowOnWheel>
pub fn row(&self, extent: f32, flat: f32) -> Option<RowOnWheel>
Where a row goes, given the viewport’s extent and where the row’s centre would sit on an unrolled strip, measured from the viewport’s centre.
None once the row has turned past a quarter — it has gone over the horizon, and
a row drawn there would be a line of text lying edge-on.
Trait Implementations§
Source§impl Clone for WheelGeometry
impl Clone for WheelGeometry
Source§fn clone(&self) -> WheelGeometry
fn clone(&self) -> WheelGeometry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WheelGeometry
Source§impl Debug for WheelGeometry
impl Debug for WheelGeometry
Source§impl Default for WheelGeometry
impl Default for WheelGeometry
Source§fn default() -> WheelGeometry
fn default() -> WheelGeometry
A diameter only a little larger than the wheel is tall, which puts the ends of the visible strip most of the way round to the horizon and is what makes a picker look like a picker rather than like a list with the ends dimmed.
These are the reference’s own numbers for its picker, and its comment on them is that they were eyeballed against a real one. That is worth repeating rather than rederiving: the geometry here is deliberately not a cylinder (see the module documentation), so a figure argued from first principles would be arguing about the wrong shape.
Source§impl PartialEq for WheelGeometry
impl PartialEq for WheelGeometry
impl StructuralPartialEq for WheelGeometry
Auto Trait Implementations§
impl Freeze for WheelGeometry
impl RefUnwindSafe for WheelGeometry
impl Send for WheelGeometry
impl Sync for WheelGeometry
impl Unpin for WheelGeometry
impl UnsafeUnpin for WheelGeometry
impl UnwindSafe for WheelGeometry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.