Struct tiny_skia_path::size::IntSize
source · pub struct IntSize {
width: NonZeroU32,
height: NonZeroU32,
}
Expand description
Fields§
§width: NonZeroU32
§height: NonZeroU32
Implementations§
source§impl IntSize
impl IntSize
sourcepub fn from_wh(width: u32, height: u32) -> Option<Self>
pub fn from_wh(width: u32, height: u32) -> Option<Self>
Creates a new IntSize
from width and height.
pub(crate) fn from_wh_safe(width: NonZeroU32, height: NonZeroU32) -> Self
sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Returns width and height as a tuple.
sourcepub fn scale_by(&self, factor: f32) -> Option<Self>
pub fn scale_by(&self, factor: f32) -> Option<Self>
Scales current size by the specified factor.
sourcepub fn scale_to_width(&self, new_width: u32) -> Option<Self>
pub fn scale_to_width(&self, new_width: u32) -> Option<Self>
Scales current size to the specified width.
sourcepub fn scale_to_height(&self, new_height: u32) -> Option<Self>
pub fn scale_to_height(&self, new_height: u32) -> Option<Self>
Scales current size to the specified height.
Trait Implementations§
impl Copy for IntSize
impl StructuralPartialEq for IntSize
Auto Trait Implementations§
impl Freeze for IntSize
impl RefUnwindSafe for IntSize
impl Send for IntSize
impl Sync for IntSize
impl Unpin for IntSize
impl UnwindSafe for IntSize
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)