pub struct OverlayPlacement {
pub side: OverlaySide,
pub align: OverlayAlign,
pub offset: f64,
pub flip: bool,
pub clamp: bool,
pub padding: f64,
}Expand description
A resolved placement request: which side, how it lines up, how far off the anchor it sits, and how it may move to stay inside the area.
Fields§
§side: OverlaySideThe preferred side.
align: OverlayAlignCross-axis alignment.
offset: f64Gap between the anchor and the surface, in logical px.
flip: boolFlip to OverlaySide::opposite when the preferred side does not fit
and the opposite one does.
clamp: boolShift the placed rect back inside the padded area when it overflows.
padding: f64The margin the surface keeps from every edge of the area, in logical px. Both the fit test and the clamp read the area inset by it.
Implementations§
Source§impl OverlayPlacement
impl OverlayPlacement
Sourcepub fn on(side: OverlaySide) -> Self
pub fn on(side: OverlaySide) -> Self
A placement on side, everything else defaulted.
Sourcepub const fn align(self, align: OverlayAlign) -> Self
pub const fn align(self, align: OverlayAlign) -> Self
Set the cross-axis alignment.
Trait Implementations§
Source§impl Clone for OverlayPlacement
impl Clone for OverlayPlacement
impl Copy for OverlayPlacement
Source§impl Debug for OverlayPlacement
impl Debug for OverlayPlacement
Source§impl Default for OverlayPlacement
impl Default for OverlayPlacement
Source§fn default() -> Self
fn default() -> Self
Below the anchor, centred, at DEFAULT_OFFSET, flipping and clamping
inside DEFAULT_PADDING of the area’s edges.
Source§impl PartialEq for OverlayPlacement
impl PartialEq for OverlayPlacement
impl StructuralPartialEq for OverlayPlacement
Auto Trait Implementations§
impl Freeze for OverlayPlacement
impl RefUnwindSafe for OverlayPlacement
impl Send for OverlayPlacement
impl Sync for OverlayPlacement
impl Unpin for OverlayPlacement
impl UnsafeUnpin for OverlayPlacement
impl UnwindSafe for OverlayPlacement
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
impl<T> Brush for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.