Trait suzy::dims::Rect [−][src]
Methods associated with controlling the dimensions of a Rectangular visual element.
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<F, R>(&mut self, f: F) -> R where
F: FnOnce(&mut Dim) -> R,
[src]
F: FnOnce(&mut Dim) -> R,
Apply a transfomation to the x dimension of the rectangle.
fn y_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(&mut Dim) -> R,
[src]
F: FnOnce(&mut Dim) -> R,
Apply a transfomation to the y dimension of the rectangle.
Provided methods
fn left(&self) -> f32
[src]
Get the left edge 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 right(&self) -> f32
[src]
Get the right edge of the rectangle
fn set_right(&mut self, value: f32)
[src]
Set the right edge of the rect and for it to grow to the left
fn bottom(&self) -> f32
[src]
Get the bottom edge of the rectangle
fn set_bottom(&mut self, value: f32)
[src]
Set the bottom edge of the rect and for it to grow upwards
fn top(&self) -> f32
[src]
Get the top edge of the rectangle
fn set_top(&mut self, value: f32)
[src]
Set the top edge of the rect and for it to grow downwards
fn center_x(&self) -> f32
[src]
Get the horizontal center of the rect
fn set_center_x(&mut self, value: f32)
[src]
Set the horizontal center of the rect and for it to grow evenly wider
fn center_y(&self) -> f32
[src]
Get the vertical center of the rect
fn set_center_y(&mut self, value: f32)
[src]
Set the vertical center of the rect and for it to grow evenly taller
fn center(&self) -> (f32, f32)
[src]
Get the center of the rect
fn set_center(&mut self, value: (f32, f32))
[src]
Set the center of the rect and for it to grow evenly outwards
fn width(&self) -> f32
[src]
Get the width of the rectangle
fn set_width(&mut self, value: f32)
[src]
Set the width of the rectangle
fn height(&self) -> f32
[src]
Get the height of the rectangle
fn set_height(&mut self, value: f32)
[src]
Set the height of the rectangle
fn pivot(&self) -> (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(&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 pivot_pos(&self) -> (f32, f32)
[src]
Get the global position of the pivot of the rectangle
fn set_pivot_pos(&mut self, value: (f32, f32))
[src]
Set the global position of the pivot of the rectangle
fn area(&self) -> f32
[src]
Get the area of the rectangle
fn aspect(&self) -> f32
[src]
Get the aspect ratio of this rectangle (width / height) Note: this may be a non-normal number
fn contains(&self, point: (f32, f32)) -> bool
[src]
Check if a point is inside the rectangle
fn set_fill_width<R: ?Sized>(&mut self, other: &R, padding: Padding) where
R: Rect,
[src]
R: Rect,
Calculate the width and horizontal position of this rect based on another rect and some padding
fn set_fill_height<R: ?Sized>(&mut self, other: &R, padding: Padding) where
R: Rect,
[src]
R: Rect,
Calculate the height and vertical position of this rect based on another rect and some padding
fn set_fill<R: ?Sized, P: ?Sized>(&mut self, other: &R, padding: &P) where
R: Rect,
P: Padding2d,
[src]
R: Rect,
P: Padding2d,
Calculate the size and position of this rect based on another rect and some padding
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
fn surrounds<R: Rect + ?Sized>(&self, other: &R) -> bool
[src]
Check if another rect is completely contained within this one
fn overlaps<R: Rect + ?Sized>(&self, other: &R) -> bool
[src]
Check if this rect overlaps at all with another
Implementors
impl Rect for &mut WidgetRect
[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,
impl Rect for SelectableSlicedImage
[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,
impl Rect for SlicedImage
[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,
impl Rect for WidgetExtra<'_>
[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,
impl Rect for WidgetRect
[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,
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]
impl<'a> Rect for FixedSizeRect
[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,
impl<'a> Rect for SimpleRect
[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,
impl<'a, T: ?Sized> Rect for ContentRef<'a, T>
[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,
impl<P: RenderPlatform> Rect for dyn AnonWidget<P>
[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]
impl<P: ?Sized, T> Rect for Widget<T, P> where
P: RenderPlatform,
T: WidgetContent<P>,
[src]
P: RenderPlatform,
T: WidgetContent<P>,
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,