summaryrefslogtreecommitdiff
path: root/FL/Fl_Rect.H
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-10 13:17:41 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-10 13:17:41 +0000
commit5591ba811aab2fc67255a4bc469e86ecc1fad37d (patch)
tree5bc79386816bd7067c65b3e36ffc81979e036386 /FL/Fl_Rect.H
parent2adaadbd944fa453d4cd6500b633e6f0f36ccae0 (diff)
Android: adding and fixing to the graphics clipping code
Android has no classic window manager, so FLTK has to make sure that popup windows, dialog boxes and multi window interfaces work as expectd. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12729 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Rect.H')
-rw-r--r--FL/Fl_Rect.H15
1 files changed, 9 insertions, 6 deletions
diff --git a/FL/Fl_Rect.H b/FL/Fl_Rect.H
index 307410ef7..134521d16 100644
--- a/FL/Fl_Rect.H
+++ b/FL/Fl_Rect.H
@@ -52,21 +52,24 @@ public:
Fl_Rect(int X, int Y, int W, int H)
: x_(X), y_(Y), w_(W), h_(H) {}
- /** This constructor creates a rectangle based on a widget's position and size. */
+ /** This constructor creates a rectangle based on a widget's position and size. */
Fl_Rect (const Fl_Widget& widget)
: x_(widget.x()), y_(widget.y()), w_(widget.w()), h_(widget.h()) {}
- /** This constructor creates a rectangle based on a widget's position and size. */
+ /** This constructor creates a rectangle based on a widget's position and size. */
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); }
+ /** 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 */
+ /** 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 */
+ /** Clone another rectangle */
+ void set(Fl_Rect *r) { x_=r->x_; y_=r->y_; w_=r->w_; h_=r->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 */