[−][src]Struct resvg::Rect
A rect representation.
Width and height are guarantee to be > 0.
Methods
impl Rect
[src]
pub fn new(x: f64, y: f64, width: f64, height: f64) -> Option<Rect>
[src]
Creates a new Rect
from values.
pub fn new_bbox() -> Rect
[src]
Creates a new Rect
for bounding box calculation.
Shorthand for Rect::new(f64::MAX, f64::MAX, 1.0, 1.0)
.
pub fn size(&self) -> Size
[src]
Returns rect's size.
pub fn x(&self) -> f64
[src]
Returns rect's X position.
pub fn y(&self) -> f64
[src]
Returns rect's Y position.
pub fn width(&self) -> f64
[src]
Returns rect's width.
pub fn height(&self) -> f64
[src]
Returns rect's height.
pub fn left(&self) -> f64
[src]
Returns rect's left edge position.
pub fn right(&self) -> f64
[src]
Returns rect's right edge position.
pub fn top(&self) -> f64
[src]
Returns rect's top edge position.
pub fn bottom(&self) -> f64
[src]
Returns rect's bottom edge position.
pub fn translate(&self, tx: f64, ty: f64) -> Rect
[src]
Translates the rect by the specified offset.
pub fn translate_to(&self, x: f64, y: f64) -> Rect
[src]
Translates the rect to the specified position.
pub fn contains(&self, x: f64, y: f64) -> bool
[src]
Checks that the rect contains a point.
pub fn expand(&self, r: Rect) -> Rect
[src]
Expands the Rect
to the provided size.
Trait Implementations
impl Clone for Rect
[src]
impl Copy for Rect
[src]
impl Debug for Rect
[src]
impl Display for Rect
[src]
impl FuzzyEq<Rect> for Rect
[src]
impl RectExt for Rect
[src]
fn bbox_transform(&self, bbox: Rect) -> Self
[src]
fn transform(&self, ts: &Transform) -> Option<Self>
[src]
fn to_screen_size(&self) -> ScreenSize
[src]
fn to_screen_rect(&self) -> ScreenRect
[src]
Auto Trait Implementations
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnwindSafe for Rect
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,