pub struct IntSize {
width: NonZero<u32>,
height: NonZero<u32>,
}
Expand description
Fields§
§width: NonZero<u32>
§height: NonZero<u32>
Implementations§
source§impl IntSize
impl IntSize
sourcepub fn from_wh(width: u32, height: u32) -> Option<IntSize>
pub fn from_wh(width: u32, height: u32) -> Option<IntSize>
Creates a new IntSize
from width and height.
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<IntSize>
pub fn scale_by(&self, factor: f32) -> Option<IntSize>
Scales current size by the specified factor.
sourcepub fn scale_to_width(&self, new_width: u32) -> Option<IntSize>
pub fn scale_to_width(&self, new_width: u32) -> Option<IntSize>
Scales current size to the specified width.
sourcepub fn scale_to_height(&self, new_height: u32) -> Option<IntSize>
pub fn scale_to_height(&self, new_height: u32) -> Option<IntSize>
Scales current size to the specified height.
Trait Implementations§
source§impl IntSizeExt for IntSize
impl IntSizeExt for IntSize
source§fn to_screen_int_rect(&self, x: u32, y: u32) -> ScreenIntRect
fn to_screen_int_rect(&self, x: u32, y: u32) -> ScreenIntRect
Converts the current size into a
IntRect
at a provided position.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
)