pub struct Size {
pub width: f64,
pub height: f64,
}Expand description
Double-precision dimensions without implicit clamping or pixel conversion.
Raw values, including negative animation overshoot, are preserved. Consumers decide which dimensions are valid for their operation.
use motion_core::prelude::*;
use motion_core::{
DisplayList, RasterLimits, ResourcePool, ValidatedDisplayList, MAX_PATH_VERBS,
MAX_STROKE_VERBS, MAX_SVG_PATH_BYTES, sample_offsets,
};
let size = Size::new(40.0, 30.0);
assert_eq!(size.to_rect(), Rect::new(0.0, 0.0, 40.0, 30.0));
assert_eq!(size.width, 40.0_f64);Fields§
§width: f64Horizontal extent in design coordinates.
height: f64Vertical extent in design coordinates.
Implementations§
Trait Implementations§
impl Copy for Size
Source§impl Interpolate for Size
impl Interpolate for Size
Source§fn interpolate(&self, target: &Self, progress: f64) -> Self
fn interpolate(&self, target: &Self, progress: f64) -> Self
Blends toward
target with nominal progress zero at self and one at target. Read moreimpl StructuralPartialEq for Size
Auto Trait Implementations§
impl Forget for Size
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnsafeUnpin for Size
impl UnwindSafe for Size
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