From 3c28f22ae9aabf72a0776daada4fa64ec74104dc Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 14 Apr 2009 20:16:08 +0000 Subject: added widget.bottom() and widget.right() geometry inspectors --- src/ui/widget.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ui/widget.h b/src/ui/widget.h index acee725..d8969cc 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -50,21 +50,39 @@ public: return widget_size; } - /// left coordinate of location() + /// x coordinate of the left of the widget /** - * @see location + * @see location() */ inline float left() const { return widget_location.x; } + + /// x coordinate of the right of the widget + /** + * @see location() + * @see size() + */ + inline float right() const { + return widget_location.x + widget_size.x; + } - /// top coordinate of location() + /// y coordinate of the top of the widget /** - * @see location + * @see location() */ inline float top() const { return widget_location.y; } + + /// y coordinate of the bottom of the widget + /** + * @see location() + * @see size() + */ + inline float bottom() const { + return widget_location.y + widget_size.y; + } /// width of the widget in pixels /** -- cgit v1.2.3