Struct usvg::ScreenRect
source · [−]pub struct ScreenRect { /* private fields */ }
Expand description
A 2D screen rect representation.
Width and height are guarantee to be > 0.
Implementations
sourceimpl ScreenRect
impl ScreenRect
sourcepub fn new(x: i32, y: i32, width: u32, height: u32) -> Option<Self>
pub fn new(x: i32, y: i32, width: u32, height: u32) -> Option<Self>
Creates a new Rect
from values.
sourcepub fn size(&self) -> ScreenSize
pub fn size(&self) -> ScreenSize
Returns rect’s size.
sourcepub fn translate_to(&self, x: i32, y: i32) -> Self
pub fn translate_to(&self, x: i32, y: i32) -> Self
Translates the rect to the specified position.
sourcepub fn fit_to_rect(&self, bounds: ScreenRect) -> Self
pub fn fit_to_rect(&self, bounds: ScreenRect) -> Self
Fits the current rect into the specified bounds.
Trait Implementations
sourceimpl Clone for ScreenRect
impl Clone for ScreenRect
sourcefn clone(&self) -> ScreenRect
fn clone(&self) -> ScreenRect
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ScreenRect
impl Debug for ScreenRect
sourceimpl Display for ScreenRect
impl Display for ScreenRect
sourceimpl PartialEq<ScreenRect> for ScreenRect
impl PartialEq<ScreenRect> for ScreenRect
sourcefn eq(&self, other: &ScreenRect) -> bool
fn eq(&self, other: &ScreenRect) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ScreenRect) -> bool
fn ne(&self, other: &ScreenRect) -> bool
This method tests for !=
.
impl Copy for ScreenRect
impl StructuralPartialEq for ScreenRect
Auto Trait Implementations
impl RefUnwindSafe for ScreenRect
impl Send for ScreenRect
impl Sync for ScreenRect
impl Unpin for ScreenRect
impl UnwindSafe for ScreenRect
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more