From c0cbf0fbde0ac33d3743a6d50bf0fa9f6664a008 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 10 Mar 2018 00:46:12 +0000 Subject: Android: crude graphics clipping git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12726 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Rect.H | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'FL/Fl_Rect.H') diff --git a/FL/Fl_Rect.H b/FL/Fl_Rect.H index 7e7d376e0..307410ef7 100644 --- a/FL/Fl_Rect.H +++ b/FL/Fl_Rect.H @@ -60,6 +60,18 @@ public: Fl_Rect (const Fl_Widget* const widget) : x_(widget->x()), y_(widget->y()), w_(widget->w()), h_(widget->h()) {} + /** Return 1 if the rectangle is empty, width or height are 0 */ + int is_empty() { return (w_==0)||(h_==0); } + + /** Set the position and size */ + void set(int x, int y, int w, int h) { x_=x; y_=y; w_=w; h_=h; } + + /** return 0 if the rectangles are different, or 1 if they are the same */ + int equals(int x, int y, int w, int h) { return ( (x_==x) && (y_==y) && (w_==w) && (h_==h) ); } + + /** Set the position and size to zero, making this rect empty */ + void clear() { x_ = y_ = w_ = h_ = 0; } + int x() const { return x_; } ///< gets the x coordinate (left edge) int y() const { return y_; } ///< gets the y coordinate (top edge) int w() const { return w_; } ///< gets the width -- cgit v1.2.3