diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2018-03-11 22:00:59 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2018-03-11 22:00:59 +0000 |
| commit | 88ce4aec17dbf37de19060f03e543e7bf26fc1af (patch) | |
| tree | 7f78eafdfdddeb7c84983fd488efbbb3d3363572 /FL/Fl_Rect.H | |
| parent | 0b1fd7ee3738e7121b35a5f7289c35c4a820e4a3 (diff) | |
Android: Made Fl_Rect virtual. Maybe a bad idea?
Also, added rectangular clipping which works.
Expanding now to a more complex clipping scheme to make multiple
windows work.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12739 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Rect.H')
| -rw-r--r-- | FL/Fl_Rect.H | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/FL/Fl_Rect.H b/FL/Fl_Rect.H index 134521d16..dc09e45a0 100644 --- a/FL/Fl_Rect.H +++ b/FL/Fl_Rect.H @@ -60,14 +60,16 @@ public: Fl_Rect (const Fl_Widget* const widget) : x_(widget->x()), y_(widget->y()), w_(widget->w()), h_(widget->h()) {} + virtual ~Fl_Rect() { } + /** 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; } + virtual void set(int x, int y, int w, int h) { x_=x; y_=y; w_=w; h_=h; } /** Clone another rectangle */ - void set(Fl_Rect *r) { x_=r->x_; y_=r->y_; w_=r->w_; h_=r->h_; } + virtual 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) ); } |
