[][src]Struct orbtk::widgets::utils::Rectangle

pub struct Rectangle {
    pub x: f64,
    pub y: f64,
    pub width: f64,
    pub height: f64,
}

Describes a new visual rectangle.

Fields

x: f64y: f64

Y position of the rectangle.

width: f64

Width of the rectangle.

height: f64

Height of the rectangle.

Methods

impl Rectangle[src]

pub fn new(x: f64, y: f64, width: f64, height: f64) -> Rectangle[src]

Create a new rectangle with the given parameters.

pub fn x(&self) -> f64[src]

Gets x.

pub fn set_x(&mut self, x: f64)[src]

Sets x.

pub fn y(&self) -> f64[src]

Gets y.

pub fn set_y(&mut self, y: f64)[src]

Sets y.

pub fn position(&self) -> (f64, f64)[src]

Gets position with x and y.

pub fn set_position(&mut self, x: f64, y: f64)[src]

Sets position with x and y.

pub fn width(&self) -> f64[src]

Gets the width.

pub fn set_width(&mut self, width: f64)[src]

Sets the width.

pub fn height(&self) -> f64[src]

Gets the height.

pub fn set_height(&mut self, height: f64)[src]

Sets the height.

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

Gets the size with width and height.

pub fn set_size(&mut self, width: f64, height: f64)[src]

Sets the size with width and height.

pub fn contains(&self, point: (f64, f64)) -> bool[src]

Check if this rect contains the given point.

pub fn contains_rect(&self, rect: &Rectangle) -> bool[src]

pub fn intersects(&self, rect: &Rectangle) -> bool[src]

Trait Implementations

impl Clone for Rectangle[src]

impl Copy for Rectangle[src]

impl Debug for Rectangle[src]

impl Default for Rectangle[src]

impl From<(f64, f64, f64, f64)> for Rectangle[src]

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

impl IntoPropertySource<Rectangle> for Rectangle[src]

impl<'_> IntoPropertySource<Rectangle> for (&'_ str, Entity)[src]

impl IntoPropertySource<Rectangle> for (String, Entity)[src]

impl IntoPropertySource<Rectangle> for (f64, f64, f64, f64)[src]

impl IntoPropertySource<Rectangle> for (i32, i32, i32, i32)[src]

impl IntoPropertySource<Rectangle> for Entity[src]

impl PartialEq<Rectangle> for Rectangle[src]

impl StructuralPartialEq for Rectangle[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<E> Component for E where
    E: Any
[src]

impl<T> From<T> for T[src]

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

impl<T> SetParameter for T

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.