pub struct FitResult {
pub clip_rect: IntRect,
pub source_to_target_x: f32,
pub source_to_target_y: f32,
pub size: Size2D<f32, PhysicalPx>,
pub offset: Point2D<f32, PhysicalPx>,
pub tiled: Option<Point2D<u32>>,
}
Expand description
The result of the fit function
Fields§
§clip_rect: IntRect
The clip rect in the source image (in source image coordinate)
source_to_target_x: f32
The scale to apply to go from the source to the target horizontally
source_to_target_y: f32
The scale to apply to go from the source to the target vertically
size: Size2D<f32, PhysicalPx>
The size of the target
offset: Point2D<f32, PhysicalPx>
The offset in the target in which we draw the image
tiled: Option<Point2D<u32>>
When Some, it means the image should be tiled instead of stretched to the target but still scaled with the source_to_target_x and source_to_target_y factor The point is the coordinate within the image’s clip_rect of the pixel at the offset
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FitResult
impl RefUnwindSafe for FitResult
impl Send for FitResult
impl Sync for FitResult
impl Unpin for FitResult
impl UnwindSafe for FitResult
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