pub struct FixedMeasure {
pub sizes: HashMap<String, (f32, f32)>,
pub wrap: bool,
}Expand description
The geometry-test measure every platform reproduces exactly: 8 px per
character on ONE 20 px line (no wrapping), fixed boxes per control, or an
explicit size per node id (fixtures/layout-geometry.json measures).
Fields§
§sizes: HashMap<String, (f32, f32)>§wrap: boolWhen true, text leaves WRAP at 8 px per character (for the list and overlay tests); the geometry fixture keeps it off.
Implementations§
Source§impl FixedMeasure
impl FixedMeasure
pub fn with_sizes(sizes: HashMap<String, (f32, f32)>) -> FixedMeasure
Sourcepub fn intrinsic(&self, leaf: &LeafRequest<'_>) -> (f32, f32)
pub fn intrinsic(&self, leaf: &LeafRequest<'_>) -> (f32, f32)
The intrinsic size of a leaf by kind (the spike’s table).
Trait Implementations§
Source§impl Clone for FixedMeasure
impl Clone for FixedMeasure
Source§impl Debug for FixedMeasure
impl Debug for FixedMeasure
Source§impl Default for FixedMeasure
impl Default for FixedMeasure
Source§impl Measure for FixedMeasure
impl Measure for FixedMeasure
Source§fn measure_id(&self) -> u64
fn measure_id(&self) -> u64
Identity of this measurer (font scale, Dynamic Type state…). Two
consecutive passes with different ids invalidate every memo.
fn measure_intrinsics(&mut self, leaves: &[LeafRequest<'_>]) -> Vec<Intrinsics>
fn measure_heights( &mut self, leaves: &[LeafRequest<'_>], requests: &[HeightRequest], ) -> Vec<f32>
Auto Trait Implementations§
impl Freeze for FixedMeasure
impl RefUnwindSafe for FixedMeasure
impl Send for FixedMeasure
impl Sync for FixedMeasure
impl Unpin for FixedMeasure
impl UnsafeUnpin for FixedMeasure
impl UnwindSafe for FixedMeasure
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
Mutably borrows from an owned value. Read more