#[repr(i32)]pub enum ScaleToFit {
Fill = 0,
Start = 1,
Center = 2,
End = 3,
}Expand description
源矩形映射到目标矩形时的缩放/对齐策略,对应 SkMatrix::ScaleToFit。
Scale/align policy when mapping a source rect to a destination rect (SkMatrix::ScaleToFit).
Variants§
Fill = 0
独立缩放 sx/sy 以完全填满 dst(可能非等比)。
Scale X and Y independently to fill dst (aspect ratio may change).
Start = 1
等比缩放并靠 dst 的「起始」边对齐(与 Skia Start 一致)。
Uniform scale; aligned to the start edge of dst per Skia.
Center = 2
等比缩放并在 dst 内居中。
Uniform scale; centered within dst.
End = 3
等比缩放并靠「结束」边对齐。
Uniform scale; aligned to the end edge of dst.
Trait Implementations§
Source§impl Clone for ScaleToFit
impl Clone for ScaleToFit
Source§fn clone(&self) -> ScaleToFit
fn clone(&self) -> ScaleToFit
Returns a duplicate of the value. Read more
1.0.0 · 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 ScaleToFit
impl Debug for ScaleToFit
Source§impl Hash for ScaleToFit
impl Hash for ScaleToFit
Source§impl PartialEq for ScaleToFit
impl PartialEq for ScaleToFit
impl Copy for ScaleToFit
impl Eq for ScaleToFit
impl StructuralPartialEq for ScaleToFit
Auto Trait Implementations§
impl Freeze for ScaleToFit
impl RefUnwindSafe for ScaleToFit
impl Send for ScaleToFit
impl Sync for ScaleToFit
impl Unpin for ScaleToFit
impl UnsafeUnpin for ScaleToFit
impl UnwindSafe for ScaleToFit
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