pub enum RectSpec {
Absolute(LayoutRect),
Percent {
x: u16,
y: u16,
width: u16,
height: u16,
},
}Expand description
A rectangle specification that can be either absolute or percentage-based.
Percentage values are relative to bounds at resolution time.
Variants§
Absolute(LayoutRect)
Fixed pixel/cell position and size.
Percent
Percentage of the bounding rectangle.
Implementations§
Source§impl RectSpec
impl RectSpec
Sourcepub fn resolve(&self, bounds: LayoutRect) -> LayoutRect
pub fn resolve(&self, bounds: LayoutRect) -> LayoutRect
Resolve this spec against bounds to produce a concrete LayoutRect.
Trait Implementations§
impl Copy for RectSpec
impl Eq for RectSpec
impl StructuralPartialEq for RectSpec
Auto Trait Implementations§
impl Freeze for RectSpec
impl RefUnwindSafe for RectSpec
impl Send for RectSpec
impl Sync for RectSpec
impl Unpin for RectSpec
impl UnsafeUnpin for RectSpec
impl UnwindSafe for RectSpec
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