[][src]Struct resvg::ScreenRect

pub struct ScreenRect {
    pub x: i32,
    pub y: i32,
    pub width: u32,
    pub height: u32,
}

A 2D screen rect representation.

Fields

x: i32y: i32width: u32height: u32

Methods

impl ScreenRect[src]

pub fn new(x: i32, y: i32, width: u32, height: u32) -> Self[src]

Creates a new Rect from values.

pub fn size(&self) -> ScreenSize[src]

Returns rect's size.

pub fn left(&self) -> i32[src]

Returns rect's left edge position.

pub fn right(&self) -> i32[src]

Returns rect's right edge position.

pub fn top(&self) -> i32[src]

Returns rect's top edge position.

pub fn bottom(&self) -> i32[src]

Returns rect's bottom edge position.

pub fn contains(&self, x: i32, y: i32) -> bool[src]

Checks that rect contains a point.

pub fn fit_to_rect(&self, bounds: ScreenRect) -> Self[src]

Fits the current rect into the specified bounds.

pub fn to_rect(&self) -> Rect[src]

Converts into Rect.

pub fn is_valid(&self) -> bool[src]

Checks that the rect has a valid size.

Trait Implementations

impl Copy for ScreenRect[src]

impl PartialEq<ScreenRect> for ScreenRect[src]

impl From<(i32, i32, u32, u32)> for ScreenRect[src]

impl Clone for ScreenRect[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for ScreenRect[src]

impl Debug for ScreenRect[src]

Auto Trait Implementations

impl Send for ScreenRect

impl Sync for ScreenRect

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]