pub struct IconRect {
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
One entry of a sprite index — a sub-rectangle of the atlas. Mirrors the
MapLibre sprite-JSON entry shape (extra keys like sdf are ignored) so a
fetched index deserializes into the same type.
Fields§
§x: u32§y: u32§width: u32§height: u32§pixel_ratio: f32§stretch_x: Vec<[u32; 2]>Nine-slice metadata: the [from, to) bands of image columns that may
stretch when icon-text-fit grows the icon. Absent = the whole image
scales.
stretch_y: Vec<[u32; 2]>The stretchable bands of image rows, as Self::stretch_x.
content: Option<[u32; 4]>The part of the image the label’s text is fitted into, as
[left, top, right, bottom] image pixels. Absent = the whole image.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IconRect
impl<'de> Deserialize<'de> for IconRect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IconRect
impl RefUnwindSafe for IconRect
impl Send for IconRect
impl Sync for IconRect
impl Unpin for IconRect
impl UnsafeUnpin for IconRect
impl UnwindSafe for IconRect
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