summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Rect.H15
-rw-r--r--FL/platform_types.h7
2 files changed, 14 insertions, 8 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 */
diff --git a/FL/platform_types.h b/FL/platform_types.h
index 286fc68d1..9f6ed1e44 100644
--- a/FL/platform_types.h
+++ b/FL/platform_types.h
@@ -114,8 +114,11 @@ struct dirent {char d_name[1];};
#elif defined(__ANDROID__)
-// see: src/driver/Android/Fl_Android_Graphics_Driver_region.cxx
-typedef struct Fl_Clip_Rect *Fl_Region;
+#ifdef __cplusplus
+typedef class Fl_Rect_Region *Fl_Region;
+#else
+typedef struct Fl_Rect_Region *Fl_Region;
+#endif
// TODO: the types below have not yet been ported
typedef unsigned long Fl_Offscreen;