Struct chromiumoxide::layout::ElementQuad
source · pub struct ElementQuad {
pub top_left: Point,
pub top_right: Point,
pub bottom_right: Point,
pub bottom_left: Point,
}
Fields§
§top_left: Point
§top_right: Point
§bottom_right: Point
§bottom_left: Point
Implementations§
source§impl ElementQuad
impl ElementQuad
pub fn from_quad(quad: &Quad) -> Self
pub fn quad_center(&self) -> Point
sourcepub fn quad_area(&self) -> f64
pub fn quad_area(&self) -> f64
Compute sum of all directed areas of adjacent triangles https://en.wikipedia.org/wiki/Polygon#Simple_polygons
pub fn height(&self) -> f64
pub fn width(&self) -> f64
sourcepub fn aspect_ratio(&self) -> f64
pub fn aspect_ratio(&self) -> f64
The width divided by the height
sourcepub fn most_right(&self) -> f64
pub fn most_right(&self) -> f64
The most right (largest) x-coordinate
sourcepub fn most_bottom(&self) -> f64
pub fn most_bottom(&self) -> f64
The most bottom (largest) y-coordinate
sourcepub fn strictly_above(&self, other: &Self) -> bool
pub fn strictly_above(&self, other: &Self) -> bool
If the most bottom point of self
is above the most top point of
other
sourcepub fn above(&self, other: &Self) -> bool
pub fn above(&self, other: &Self) -> bool
If the most bottom point of self
is above or on the same line as the
most top point of other
sourcepub fn strictly_below(&self, other: &Self) -> bool
pub fn strictly_below(&self, other: &Self) -> bool
If the most top point of self
is below the most bottom point of
other
sourcepub fn below(&self, other: &Self) -> bool
pub fn below(&self, other: &Self) -> bool
If the most top point of self
is below or on the same line as the
most bottom point of other
sourcepub fn strictly_left_of(&self, other: &Self) -> bool
pub fn strictly_left_of(&self, other: &Self) -> bool
If the most right point of self
is left of the most left point of
other
sourcepub fn left_of(&self, other: &Self) -> bool
pub fn left_of(&self, other: &Self) -> bool
If the most right point of self
is left or on the same line as the
most left point of other
sourcepub fn strictly_right_of(&self, other: &Self) -> bool
pub fn strictly_right_of(&self, other: &Self) -> bool
If the most left point of self
is right of the most right point of
other
sourcepub fn right_of(&self, other: &Self) -> bool
pub fn right_of(&self, other: &Self) -> bool
If the most left point of self
is right or on the same line as the
most right point of other
sourcepub fn within_horizontal_bounds_of(&self, other: &Self) -> bool
pub fn within_horizontal_bounds_of(&self, other: &Self) -> bool
If self
is within the left/right boundaries defined by other
.
sourcepub fn within_vertical_bounds_of(&self, other: &Self) -> bool
pub fn within_vertical_bounds_of(&self, other: &Self) -> bool
If self
is within the top/bottom boundaries defined by other
.
sourcepub fn within_bounds_of(&self, other: &Self) -> bool
pub fn within_bounds_of(&self, other: &Self) -> bool
If self
is within the boundaries defined by other
.
Trait Implementations§
source§impl Clone for ElementQuad
impl Clone for ElementQuad
source§fn clone(&self) -> ElementQuad
fn clone(&self) -> ElementQuad
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more