From 239bbf6ec8f5b5765b8434da6988a567246bb324 Mon Sep 17 00:00:00 2001 From: Erin Date: Sun, 5 Nov 2017 20:40:29 -0600 Subject: [PATCH] textium: Rect: add gl_bottom() --- textium/src/geometry.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/textium/src/geometry.rs b/textium/src/geometry.rs index b58a789..8ab5189 100644 --- a/textium/src/geometry.rs +++ b/textium/src/geometry.rs @@ -39,9 +39,12 @@ impl Rect /// Return the position of the left edge of the rectangle. #[inline(always)] 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)] 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. #[inline(always)] pub fn right(&self) -> T {self.x + self.w}