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
impl Copy for WheelGeometry
Source§impl Debug for WheelGeometry
impl Debug for WheelGeometry
Source§impl Default for WheelGeometry
impl Default for WheelGeometry
Source§fn default() -> Self
fn default() -> Self
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.