pub struct SpriteRect {
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
pub pixel_ratio: f32,
pub stretch_x: Vec<[u32; 2]>,
pub stretch_y: Vec<[u32; 2]>,
pub content: Option<[u32; 4]>,
}Expand description
A sub-rectangle of a sprite atlas: one named icon.
Fields§
§x: u32§y: u32§width: u32§height: u32§pixel_ratio: f32Device pixels per logical pixel the icon was authored at (a @2x
sprite has pixel_ratio == 2.0). Consumers divide by it to get the
icon’s intended display size.
stretch_x: Vec<[u32; 2]>Nine-slice metadata for icon-text-fit: the [from, to) bands of
image columns (resp. rows) that absorb the stretch, and the part of
the image the text is fitted into. Empty / None means the whole
image stretches and the whole image is the content box.
stretch_y: Vec<[u32; 2]>§content: Option<[u32; 4]>Trait Implementations§
Source§impl Clone for SpriteRect
impl Clone for SpriteRect
Source§fn clone(&self) -> SpriteRect
fn clone(&self) -> SpriteRect
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 moreSource§impl Debug for SpriteRect
impl Debug for SpriteRect
Source§impl Default for SpriteRect
impl Default for SpriteRect
Source§fn default() -> SpriteRect
fn default() -> SpriteRect
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpriteRect
impl RefUnwindSafe for SpriteRect
impl Send for SpriteRect
impl Sync for SpriteRect
impl Unpin for SpriteRect
impl UnsafeUnpin for SpriteRect
impl UnwindSafe for SpriteRect
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