pub struct SrcRect {
pub x: f64,
pub y: f64,
pub w: f64,
pub h: f64,
}Expand description
A sub-rectangle within the source image used as the effective source for a
SceneCommand::DrawImage command.
All four coordinates are in source-image pixels (top-left origin). The rect is clamped to the source image bounds at render time; a degenerate rect (zero width or height after clamping) causes the draw to be skipped.
Applies to raster kind="image" assets only; ignored for SVG assets (vector
assets are resolution-independent and src-rect is a raster concept). This is
a documented v0 limitation.
Fields§
§x: f64Left edge of the crop in source pixels.
y: f64Top edge of the crop in source pixels.
w: f64Width of the crop in source pixels (> 0).
h: f64Height of the crop in source pixels (> 0).
Trait Implementations§
impl StructuralPartialEq for SrcRect
Auto Trait Implementations§
impl Freeze for SrcRect
impl RefUnwindSafe for SrcRect
impl Send for SrcRect
impl Sync for SrcRect
impl Unpin for SrcRect
impl UnsafeUnpin for SrcRect
impl UnwindSafe for SrcRect
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