pub enum ObjectFit {
Contain,
Cover,
Fill,
None,
}Expand description
How an image fits inside its target frame (Element::Image.frame, pt/px coordinates).
Mirrors the ObjectFit concept used by downstream crates such as liepress, but is a
self-contained enum in the lievisual IR so the rendering layer does not depend on a
document layer.
Variants§
Contain
Scale to fit while preserving aspect ratio, fully visible (may pad inside the frame).
Corresponds to SVG meet.
Cover
Scale to fill while preserving aspect ratio, cropping the overflow. Corresponds to SVG slice.
Fill
Stretch to fill the frame (may distort).
None
No scaling; place at the frame’s top-left at original pixel size (may overflow or pad).
Trait Implementations§
impl Copy for ObjectFit
impl Eq for ObjectFit
impl StructuralPartialEq for ObjectFit
Auto Trait Implementations§
impl Freeze for ObjectFit
impl RefUnwindSafe for ObjectFit
impl Send for ObjectFit
impl Sync for ObjectFit
impl Unpin for ObjectFit
impl UnsafeUnpin for ObjectFit
impl UnwindSafe for ObjectFit
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