pub struct SourceRect {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}Expand description
A rectangle in texels, as a sprite’s source.
Deliberately not the canvas Rect, which is in user space: a sheet
rectangle and a destination rectangle are different things, and the one
mistake this call invites is passing one where the other belongs.
Fields§
§x: f32§y: f32§width: f32§height: f32Implementations§
Trait Implementations§
Source§impl Clone for SourceRect
impl Clone for SourceRect
impl Copy for SourceRect
Source§impl Debug for SourceRect
impl Debug for SourceRect
Source§impl PartialEq for SourceRect
impl PartialEq for SourceRect
impl StructuralPartialEq for SourceRect
Auto Trait Implementations§
impl Forget for SourceRect
impl Freeze for SourceRect
impl Move for SourceRect
impl RefUnwindSafe for SourceRect
impl Send for SourceRect
impl Sync for SourceRect
impl Unpin for SourceRect
impl UnsafeUnpin for SourceRect
impl UnwindSafe for SourceRect
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more