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) -> OverlayPlacement
pub fn on(side: OverlaySide) -> OverlayPlacement
A placement on side, everything else defaulted.
Sourcepub const fn align(self, align: OverlayAlign) -> OverlayPlacement
pub const fn align(self, align: OverlayAlign) -> OverlayPlacement
Set the cross-axis alignment.
Sourcepub const fn offset(self, offset: f64) -> OverlayPlacement
pub const fn offset(self, offset: f64) -> OverlayPlacement
Set the anchor gap, in logical px.
Sourcepub const fn flip(self, flip: bool) -> OverlayPlacement
pub const fn flip(self, flip: bool) -> OverlayPlacement
Enable or disable the collision flip.
Sourcepub const fn clamp(self, clamp: bool) -> OverlayPlacement
pub const fn clamp(self, clamp: bool) -> OverlayPlacement
Enable or disable the shift-back-inside clamp.
Sourcepub const fn padding(self, padding: f64) -> OverlayPlacement
pub const fn padding(self, padding: f64) -> OverlayPlacement
Set the margin kept from the area’s edges, in logical px.
Trait Implementations§
Source§impl Clone for OverlayPlacement
impl Clone for OverlayPlacement
Source§fn clone(&self) -> OverlayPlacement
fn clone(&self) -> OverlayPlacement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OverlayPlacement
Source§impl Debug for OverlayPlacement
impl Debug for OverlayPlacement
Source§impl Default for OverlayPlacement
impl Default for OverlayPlacement
Source§fn default() -> OverlayPlacement
fn default() -> OverlayPlacement
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.