pub enum AnchorPoint {
TopLeft,
Top,
TopRight,
Left,
Center,
Right,
BottomLeft,
Bottom,
BottomRight,
}Expand description
One of the nine points of a NinePointAnchor.
Variants§
TopLeft
The top left corner.
Top
The middle of the top edge.
TopRight
The top right corner.
Left
The middle of the left edge.
Center
The middle.
Right
The middle of the right edge.
BottomLeft
The bottom left corner.
Bottom
The middle of the bottom edge.
BottomRight
The bottom right corner.
Implementations§
Source§impl AnchorPoint
impl AnchorPoint
Sourcepub const ALL: [AnchorPoint; 9]
pub const ALL: [AnchorPoint; 9]
All nine, row by row from the top left.
Sourcepub fn fraction(self) -> (f32, f32)
pub fn fraction(self) -> (f32, f32)
Where it falls in a box, as a share of the width and of the height.
use ravenrs_widgets::AnchorPoint;
assert_eq!(AnchorPoint::Right.fraction(), (1.0, 0.5));Sourcepub fn from_fraction(x: f32, y: f32) -> AnchorPoint
pub fn from_fraction(x: f32, y: f32) -> AnchorPoint
The point nearest to these shares of a box.
Trait Implementations§
Source§impl Clone for AnchorPoint
impl Clone for AnchorPoint
Source§fn clone(&self) -> AnchorPoint
fn clone(&self) -> AnchorPoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AnchorPoint
Source§impl Debug for AnchorPoint
impl Debug for AnchorPoint
Source§impl Default for AnchorPoint
impl Default for AnchorPoint
Source§fn default() -> AnchorPoint
fn default() -> AnchorPoint
Returns the “default value” for a type. Read more
impl Eq for AnchorPoint
Source§impl Hash for AnchorPoint
impl Hash for AnchorPoint
Source§impl PartialEq for AnchorPoint
impl PartialEq for AnchorPoint
impl StructuralPartialEq for AnchorPoint
Auto Trait Implementations§
impl Freeze for AnchorPoint
impl RefUnwindSafe for AnchorPoint
impl Send for AnchorPoint
impl Sync for AnchorPoint
impl Unpin for AnchorPoint
impl UnsafeUnpin for AnchorPoint
impl UnwindSafe for AnchorPoint
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
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,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.