#[non_exhaustive]pub enum Placement {
At(i64, i64),
Gravity(Position),
Tiled(Position),
TiledFrom(i64, i64),
}Expand description
Where the overlay goes: sharp’s left/top, gravity and tile.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
At(i64, i64)
The overlay’s top-left corner at (x, y) in base coordinates.
Negative offsets clip rather than fail.
Gravity(Position)
Against an edge, a corner or the middle of the base, as sharp’s
gravity places it. An overlay larger than the base overhangs it
evenly and is clipped.
Tiled(Position)
Repeated over the whole base, aligned as sharp aligns tile with a
gravity: centred, for instance, puts one copy in the middle.
TiledFrom(i64, i64)
Repeated over the whole base, the base’s top-left pixel showing the
overlay’s pixel at (x, y) (taken modulo its size), as sharp’s
tile with left and top does.
Trait Implementations§
impl Copy for Placement
impl Eq for Placement
impl StructuralPartialEq for Placement
Auto Trait Implementations§
impl Freeze for Placement
impl RefUnwindSafe for Placement
impl Send for Placement
impl Sync for Placement
impl Unpin for Placement
impl UnsafeUnpin for Placement
impl UnwindSafe for Placement
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