Trait suzy::dims::DynRect [−][src]
An object-safe version of the Rect trait
Required methods
fn x(&self) -> Dim
[src]
Get the x dimension of the rectangle.
fn y(&self) -> Dim
[src]
Get the y dimension of the rectangle.
fn x_mut<'a>(&mut self, f: Box<dyn FnOnce(&mut Dim) + 'a>)
[src]
Apply a transfomation to the x dimension of the rectangle.
fn y_mut<'a>(&mut self, f: Box<dyn FnOnce(&mut Dim) + 'a>)
[src]
Apply a transfomation to the y dimension of the rectangle.
fn set_left(&mut self, value: f32)
[src]
Set the left edge of the rect and for it to grow to the right
fn set_right(&mut self, value: f32)
[src]
Set the right edge of the rect and for it to grow to the left
fn set_bottom(&mut self, value: f32)
[src]
Set the bottom edge of the rect and for it to grow upwards
fn set_top(&mut self, value: f32)
[src]
Set the top edge of the rect and for it to grow downwards
fn set_center_x(&mut self, value: f32)
[src]
Set the horizontal center of the rect and for it to grow evenly wider
fn set_center_y(&mut self, value: f32)
[src]
Set the vertical center of the rect and for it to grow evenly taller
fn set_center(&mut self, value: (f32, f32))
[src]
Set the center of the rect and for it to grow evenly outwards
fn set_width(&mut self, value: f32)
[src]
Set the width of the rectangle
fn set_height(&mut self, value: f32)
[src]
Set the height of the rectangle
fn set_pivot(&mut self, value: (f32, f32))
[src]
Set the pivot. A pivot of (0.5, 0.5) indicates that a rect will grow from it’s center, whereas a pivot of (0, 0) indicates that a rect will grow from it’s bottom left corner.
fn set_pivot_pos(&mut self, value: (f32, f32))
[src]
Set the global position of the pivot of the rectangle
fn shrink_to_aspect(&mut self, aspect: f32)
[src]
Shink one of the lengths of this rect so that the rect’s aspect ratio becomes the one provided
fn grow_to_aspect(&mut self, aspect: f32)
[src]
Expand one of the lengths of this rect so that the rect’s aspect ratio becomes the one provided
Trait Implementations
impl Rect for dyn DynRect
[src]
fn x(&self) -> Dim
[src]
fn y(&self) -> Dim
[src]
fn x_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(&mut Dim) -> R,
[src]
F: FnOnce(&mut Dim) -> R,
fn y_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(&mut Dim) -> R,
[src]
F: FnOnce(&mut Dim) -> R,
fn set_left(&mut self, value: f32)
[src]
fn set_right(&mut self, value: f32)
[src]
fn set_bottom(&mut self, value: f32)
[src]
fn set_top(&mut self, value: f32)
[src]
fn set_center_x(&mut self, value: f32)
[src]
fn set_center_y(&mut self, value: f32)
[src]
fn set_center(&mut self, value: (f32, f32))
[src]
fn set_width(&mut self, value: f32)
[src]
fn set_height(&mut self, value: f32)
[src]
fn set_pivot(&mut self, value: (f32, f32))
[src]
fn set_pivot_pos(&mut self, value: (f32, f32))
[src]
fn shrink_to_aspect(&mut self, aspect: f32)
[src]
fn grow_to_aspect(&mut self, aspect: f32)
[src]
fn left(&self) -> f32
[src]
fn right(&self) -> f32
[src]
fn bottom(&self) -> f32
[src]
fn top(&self) -> f32
[src]
fn center_x(&self) -> f32
[src]
fn center_y(&self) -> f32
[src]
fn center(&self) -> (f32, f32)
[src]
fn width(&self) -> f32
[src]
fn height(&self) -> f32
[src]
fn pivot(&self) -> (f32, f32)
[src]
fn pivot_pos(&self) -> (f32, f32)
[src]
fn area(&self) -> f32
[src]
fn aspect(&self) -> f32
[src]
fn contains(&self, point: (f32, f32)) -> bool
[src]
fn set_fill_width<R: ?Sized>(&mut self, other: &R, padding: Padding) where
R: Rect,
[src]
R: Rect,
fn set_fill_height<R: ?Sized>(&mut self, other: &R, padding: Padding) where
R: Rect,
[src]
R: Rect,
fn set_fill<R: ?Sized, P: ?Sized>(&mut self, other: &R, padding: &P) where
R: Rect,
P: Padding2d,
[src]
R: Rect,
P: Padding2d,