Struct rg3d_core::math::Rect [−][src]
Fields
position: Vector2<T>size: Vector2<T>Implementations
#[must_use = "this method creates new instance of rect"]pub fn inflate(&self, dw: T, dh: T) -> Self[src]#[must_use = "this method creates new instance of rect"]pub fn deflate(&self, dw: T, dh: T) -> Self[src]Extends rect to contain given point.
Notes
To build bounding rectangle you should correctly initialize initial rectangle:
let vertices = [Vector2::new(1.0, 2.0), Vector2::new(-3.0, 5.0)]; // This is important part, it must have "invalid" state to correctly // calculate bounding rect. Rect::default will give invalid result! let mut bounding_rect = Rect::new(f32::MAX, f32::MAX, 0.0, 0.0); for &v in &vertices { bounding_rect.push(v); }
#[must_use = "this method creates new instance of rect"]pub fn clip_by(&self, other: Rect<T>) -> Rect<T>[src]Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Rect<T> where
T: RefUnwindSafe, impl<T> UnwindSafe for Rect<T> where
T: UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = TShould always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> boolChecks if self is actually part of its subset T (and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SSUse with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SPThe inclusion map: converts self to the equivalent element of its superset.
pub fn vzip(self) -> V