pub struct NineSliceRects { /* private fields */ }Expand description
The nine source or destination sub-rectangles produced by a nine-slice split.
Stored as a three-by-three grid in reading order — row 0 is the top
(TOP_LEFT, TOP, TOP_RIGHT), row 1 the middle (LEFT, CENTER,
RIGHT), row 2 the bottom (BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT).
The named accessors read through those indices, so callers get
self-documenting access while the storage stays a single array that
can be iterated directly when emitting the nine drawImage calls.
Implementations§
Source§impl NineSliceRects
Implements named access over the three-by-three nine-slice grid.
impl NineSliceRects
Implements named access over the three-by-three nine-slice grid.
The index constants live in this module’s const.rs; each accessor
maps a grid position to a self-documenting name so call sites and
assert messages read as geometry rather than as (row, column) pairs.
Sourcepub fn get_top_left(&self) -> Rect
pub fn get_top_left(&self) -> Rect
Sourcepub fn get_top_right(&self) -> Rect
pub fn get_top_right(&self) -> Rect
Sourcepub fn get_center(&self) -> Rect
pub fn get_center(&self) -> Rect
Sourcepub fn get_bottom_left(&self) -> Rect
pub fn get_bottom_left(&self) -> Rect
Sourcepub fn get_bottom(&self) -> Rect
pub fn get_bottom(&self) -> Rect
Sourcepub fn get_bottom_right(&self) -> Rect
pub fn get_bottom_right(&self) -> Rect
Trait Implementations§
Source§impl Clone for NineSliceRects
impl Clone for NineSliceRects
impl Copy for NineSliceRects
Source§impl Debug for NineSliceRects
impl Debug for NineSliceRects
Source§impl PartialEq for NineSliceRects
impl PartialEq for NineSliceRects
impl StructuralPartialEq for NineSliceRects
Auto Trait Implementations§
impl Freeze for NineSliceRects
impl RefUnwindSafe for NineSliceRects
impl Send for NineSliceRects
impl Sync for NineSliceRects
impl Unpin for NineSliceRects
impl UnsafeUnpin for NineSliceRects
impl UnwindSafe for NineSliceRects
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