|
@ -39,9 +39,12 @@ impl<T> Rect<T> |
|
|
/// Return the position of the left edge of the rectangle.
|
|
|
/// Return the position of the left edge of the rectangle.
|
|
|
#[inline(always)]
|
|
|
#[inline(always)]
|
|
|
pub fn left(&self) -> T {self.x}
|
|
|
pub fn left(&self) -> T {self.x}
|
|
|
/// Return the position of the bottom edge of the rectangle.
|
|
|
|
|
|
|
|
|
/// Return the position of the bottom edge of the rectangle (coord system with 0 at top).
|
|
|
#[inline(always)]
|
|
|
#[inline(always)]
|
|
|
pub fn bottom(&self) -> T {self.y + self.h}
|
|
|
pub fn bottom(&self) -> T {self.y + self.h}
|
|
|
|
|
|
/// Return the position of the bottom edge of the rectangle (gl/mathematical coord system).
|
|
|
|
|
|
#[inline(always)]
|
|
|
|
|
|
pub fn gl_bottom(&self) -> T {self.y - self.h}
|
|
|
/// Return the position of the right edge of the rectangle.
|
|
|
/// Return the position of the right edge of the rectangle.
|
|
|
#[inline(always)]
|
|
|
#[inline(always)]
|
|
|
pub fn right(&self) -> T {self.x + self.w}
|
|
|
pub fn right(&self) -> T {self.x + self.w}
|
|
|