Struct nannou::ui::position::rect::Rect [−][src]
Defines a Rectangle's bounds across the x and y axes.
This is a conrod-specific Rectangle in that it's designed to help with layout.
Fields
x: Range
The start and end positions of the Rectangle on the x axis.
y: Range
The start and end positions of the Rectangle on the y axis.
Methods
impl Rect
[src]
impl Rect
pub fn from_xy_dim(xy: [f64; 2], dim: [f64; 2]) -> Rect
[src]
pub fn from_xy_dim(xy: [f64; 2], dim: [f64; 2]) -> Rect
Construct a Rect from a given Point
and Dimensions
.
pub fn from_corners(a: [f64; 2], b: [f64; 2]) -> Rect
[src]
pub fn from_corners(a: [f64; 2], b: [f64; 2]) -> Rect
Construct a Rect from the coordinates of two points.
pub fn overlap(self, other: Rect) -> Option<Rect>
[src]
pub fn overlap(self, other: Rect) -> Option<Rect>
The Rect representing the area in which two Rects overlap.
pub fn max(self, other: Rect) -> Rect
[src]
pub fn max(self, other: Rect) -> Rect
The Rect that encompass the two given sets of Rect.
pub fn x(&self) -> f64
[src]
pub fn x(&self) -> f64
The position in the middle of the x bounds.
pub fn y(&self) -> f64
[src]
pub fn y(&self) -> f64
The position in the middle of the y bounds.
pub fn xy(&self) -> [f64; 2]
[src]
pub fn xy(&self) -> [f64; 2]
The xy position in the middle of the bounds.
pub fn x_y(&self) -> (f64, f64)
[src]
pub fn x_y(&self) -> (f64, f64)
The centered x and y coordinates as a tuple.
pub fn w(&self) -> f64
[src]
pub fn w(&self) -> f64
The width of the Rect.
pub fn h(&self) -> f64
[src]
pub fn h(&self) -> f64
The height of the Rect.
pub fn dim(&self) -> [f64; 2]
[src]
pub fn dim(&self) -> [f64; 2]
The total dimensions of the Rect.
pub fn w_h(&self) -> (f64, f64)
[src]
pub fn w_h(&self) -> (f64, f64)
The width and height of the Rect as a tuple.
pub fn xy_dim(&self) -> ([f64; 2], [f64; 2])
[src]
pub fn xy_dim(&self) -> ([f64; 2], [f64; 2])
Convert the Rect to a Point
and Dimensions
.
pub fn x_y_w_h(&self) -> (f64, f64, f64, f64)
[src]
pub fn x_y_w_h(&self) -> (f64, f64, f64, f64)
The Rect's centered coordinates and dimensions in a tuple.
pub fn len(&self) -> f64
[src]
pub fn len(&self) -> f64
The length of the longest side of the rectangle.
pub fn bottom(&self) -> f64
[src]
pub fn bottom(&self) -> f64
The Rect's lowest y value.
pub fn top(&self) -> f64
[src]
pub fn top(&self) -> f64
The Rect's highest y value.
pub fn left(&self) -> f64
[src]
pub fn left(&self) -> f64
The Rect's lowest x value.
pub fn right(&self) -> f64
[src]
pub fn right(&self) -> f64
The Rect's highest x value.
pub fn top_left(&self) -> [f64; 2]
[src]
pub fn top_left(&self) -> [f64; 2]
The top left corner Point.
pub fn bottom_left(&self) -> [f64; 2]
[src]
pub fn bottom_left(&self) -> [f64; 2]
The bottom left corner Point.
pub fn top_right(&self) -> [f64; 2]
[src]
pub fn top_right(&self) -> [f64; 2]
The top right corner Point.
pub fn bottom_right(&self) -> [f64; 2]
[src]
pub fn bottom_right(&self) -> [f64; 2]
The bottom right corner Point.
pub fn l_r_b_t(&self) -> (f64, f64, f64, f64)
[src]
pub fn l_r_b_t(&self) -> (f64, f64, f64, f64)
The edges of the Rect in a tuple (top, bottom, left, right).
pub fn l_t_w_h(&self) -> (f64, f64, f64, f64)
[src]
pub fn l_t_w_h(&self) -> (f64, f64, f64, f64)
The left and top edges of the Rect along with the width and height.
pub fn l_b_w_h(&self) -> (f64, f64, f64, f64)
[src]
pub fn l_b_w_h(&self) -> (f64, f64, f64, f64)
The left and bottom edges of the Rect along with the width and height.
pub fn shift_x(self, x: f64) -> Rect
[src]
pub fn shift_x(self, x: f64) -> Rect
Shift the Rect along the x axis.
pub fn shift_y(self, y: f64) -> Rect
[src]
pub fn shift_y(self, y: f64) -> Rect
Shift the Rect along the y axis.
pub fn shift(self, xy: [f64; 2]) -> Rect
[src]
pub fn shift(self, xy: [f64; 2]) -> Rect
Shift the Rect by the given Point.
pub fn relative_to_x(self, x: f64) -> Rect
[src]
pub fn relative_to_x(self, x: f64) -> Rect
Returns a Rect
with a position relative to the given position on the x axis.
pub fn relative_to_y(self, y: f64) -> Rect
[src]
pub fn relative_to_y(self, y: f64) -> Rect
Returns a Rect
with a position relative to the given position on the y axis.
pub fn relative_to(self, xy: [f64; 2]) -> Rect
[src]
pub fn relative_to(self, xy: [f64; 2]) -> Rect
Returns a Rect
with a position relative to the given position.
pub fn is_over(&self, xy: [f64; 2]) -> bool
[src]
pub fn is_over(&self, xy: [f64; 2]) -> bool
Does the given point touch the Rectangle.
pub fn pad_left(self, pad: f64) -> Rect
[src]
pub fn pad_left(self, pad: f64) -> Rect
The Rect with some padding applied to the left edge.
pub fn pad_right(self, pad: f64) -> Rect
[src]
pub fn pad_right(self, pad: f64) -> Rect
The Rect with some padding applied to the right edge.
pub fn pad_bottom(self, pad: f64) -> Rect
[src]
pub fn pad_bottom(self, pad: f64) -> Rect
The rect with some padding applied to the bottom edge.
pub fn pad_top(self, pad: f64) -> Rect
[src]
pub fn pad_top(self, pad: f64) -> Rect
The Rect with some padding applied to the top edge.
pub fn pad(self, pad: f64) -> Rect
[src]
pub fn pad(self, pad: f64) -> Rect
The Rect with some padding amount applied to each edge.
pub fn padding(self, padding: Padding) -> Rect
[src]
pub fn padding(self, padding: Padding) -> Rect
The Rect with some padding applied.
pub fn stretch_to_point(self, point: [f64; 2]) -> Rect
[src]
pub fn stretch_to_point(self, point: [f64; 2]) -> Rect
Stretches the closest edge(s) to the given point if the point lies outside of the Rect area.
pub fn left_of(self, other: Rect) -> Rect
[src]
pub fn left_of(self, other: Rect) -> Rect
Align self
's right edge with the left edge of the other
Rect.
pub fn right_of(self, other: Rect) -> Rect
[src]
pub fn right_of(self, other: Rect) -> Rect
Align self
's left edge with the right dge of the other
Rect.
pub fn below(self, other: Rect) -> Rect
[src]
pub fn below(self, other: Rect) -> Rect
Align self
's top edge with the bottom edge of the other
Rect.
pub fn above(self, other: Rect) -> Rect
[src]
pub fn above(self, other: Rect) -> Rect
Align self
's bottom edge with the top edge of the other
Rect.
pub fn align_x_of(self, align: Align, other: Rect) -> Rect
[src]
pub fn align_x_of(self, align: Align, other: Rect) -> Rect
Align self
to other
along the x axis in accordance with the given Align
variant.
pub fn align_y_of(self, align: Align, other: Rect) -> Rect
[src]
pub fn align_y_of(self, align: Align, other: Rect) -> Rect
Align self
to other
along the y axis in accordance with the given Align
variant.
pub fn align_left_of(self, other: Rect) -> Rect
[src]
pub fn align_left_of(self, other: Rect) -> Rect
Align self
's left edge with the left edge of the other
Rect.
pub fn align_middle_x_of(self, other: Rect) -> Rect
[src]
pub fn align_middle_x_of(self, other: Rect) -> Rect
Align the middle of self
with the middle of the other
Rect along the x axis.
pub fn align_right_of(self, other: Rect) -> Rect
[src]
pub fn align_right_of(self, other: Rect) -> Rect
Align self
's right edge with the right edge of the other
Rect.
pub fn align_bottom_of(self, other: Rect) -> Rect
[src]
pub fn align_bottom_of(self, other: Rect) -> Rect
Align self
's bottom edge with the bottom edge of the other
Rect.
pub fn align_middle_y_of(self, other: Rect) -> Rect
[src]
pub fn align_middle_y_of(self, other: Rect) -> Rect
Align the middle of self
with the middle of the other
Rect along the y axis.
pub fn align_top_of(self, other: Rect) -> Rect
[src]
pub fn align_top_of(self, other: Rect) -> Rect
Align self
's top edge with the top edge of the other
Rect.
pub fn top_left_of(self, other: Rect) -> Rect
[src]
pub fn top_left_of(self, other: Rect) -> Rect
Place self
along the top left edges of the other
Rect.
pub fn top_right_of(self, other: Rect) -> Rect
[src]
pub fn top_right_of(self, other: Rect) -> Rect
Place self
along the top right edges of the other
Rect.
pub fn bottom_left_of(self, other: Rect) -> Rect
[src]
pub fn bottom_left_of(self, other: Rect) -> Rect
Place self
along the bottom left edges of the other
Rect.
pub fn bottom_right_of(self, other: Rect) -> Rect
[src]
pub fn bottom_right_of(self, other: Rect) -> Rect
Place self
along the bottom right edges of the other
Rect.
pub fn mid_top_of(self, other: Rect) -> Rect
[src]
pub fn mid_top_of(self, other: Rect) -> Rect
Place self
in the middle of the top edge of the other
Rect.
pub fn mid_bottom_of(self, other: Rect) -> Rect
[src]
pub fn mid_bottom_of(self, other: Rect) -> Rect
Place self
in the middle of the bottom edge of the other
Rect.
pub fn mid_left_of(self, other: Rect) -> Rect
[src]
pub fn mid_left_of(self, other: Rect) -> Rect
Place self
in the middle of the left edge of the other
Rect.
pub fn mid_right_of(self, other: Rect) -> Rect
[src]
pub fn mid_right_of(self, other: Rect) -> Rect
Place self
in the middle of the right edge of the other
Rect.
pub fn middle_of(self, other: Rect) -> Rect
[src]
pub fn middle_of(self, other: Rect) -> Rect
Place self
directly in the middle of the other
Rect.
pub fn closest_corner(&self, xy: [f64; 2]) -> Corner
[src]
pub fn closest_corner(&self, xy: [f64; 2]) -> Corner
Return the Corner of self
that is closest to the given Point.
Trait Implementations
impl Clone for Rect
[src]
impl Clone for Rect
fn clone(&self) -> Rect
[src]
fn clone(&self) -> Rect
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Rect
[src]
impl Debug for Rect
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Copy for Rect
[src]
impl Copy for Rect
impl PartialEq<Rect> for Rect
[src]
impl PartialEq<Rect> for Rect