Struct gelatin::misc::LogicalRect
source · [−]pub struct LogicalRect {
pub pos: LogicalVector,
pub size: LogicalVector,
}
Fields
pos: LogicalVector
The position of the top left corner of this rectangle
size: LogicalVector
Implementations
sourceimpl LogicalRect
impl LogicalRect
pub fn left(&self) -> f32
pub fn right(&self) -> f32
pub fn bottom(&self) -> f32
pub fn top(&self) -> f32
pub fn center(&self) -> LogicalVector
pub fn contains(&self, point: LogicalVector) -> bool
sourcepub fn align_to_pixels(self, dpi_scale: f32) -> LogicalRect
pub fn align_to_pixels(self, dpi_scale: f32) -> LogicalRect
Set the position and the size so that they will line up with pyhsical display pixels.
Trait Implementations
sourceimpl Clone for LogicalRect
impl Clone for LogicalRect
sourcefn clone(&self) -> LogicalRect
fn clone(&self) -> LogicalRect
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LogicalRect
impl Debug for LogicalRect
sourceimpl Default for LogicalRect
impl Default for LogicalRect
sourcefn default() -> LogicalRect
fn default() -> LogicalRect
Returns the “default value” for a type. Read more
impl Copy for LogicalRect
Auto Trait Implementations
impl RefUnwindSafe for LogicalRect
impl Send for LogicalRect
impl Sync for LogicalRect
impl Unpin for LogicalRect
impl UnwindSafe for LogicalRect
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Content for Twhere
T: Copy,
impl<T> Content for Twhere
T: Copy,
type Owned = T
type Owned = T
A type that holds a sized version of the content.
sourcefn read<F, E>(size: usize, f: F) -> Result<T, E>where
F: FnOnce(&mut T) -> Result<(), E>,
fn read<F, E>(size: usize, f: F) -> Result<T, E>where
F: FnOnce(&mut T) -> Result<(), E>,
Prepares an output buffer, then turns this buffer into an
Owned
.sourcefn get_elements_size() -> usize
fn get_elements_size() -> usize
Returns the size of each element.
sourcefn to_void_ptr(&self) -> *const ()
fn to_void_ptr(&self) -> *const ()
Produces a pointer to the data.
sourcefn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut T>
fn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut T>
Builds a pointer to this type from a raw pointer.
sourcefn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Returns true if the size is suitable to store a type like this.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_big_endian()
.sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_native_endian()
.