summaryrefslogtreecommitdiff
path: root/FL/Fl_Rect.H
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-11-22 14:45:07 +0100
committerMatthias Melcher <github@matthiasm.com>2023-11-22 14:45:13 +0100
commit81e26b9089f83a608768fdb39aa63f33ce169521 (patch)
treee07955ac9c6299184f1a9e557174efd2b2ce2039 /FL/Fl_Rect.H
parent9383f172a88f847192e0082e080c0855316b794a (diff)
Adding size range settings to Fl_Tile, initial commit.
- some documentation missing - Fl_Tile::resize() not satisfying yet - minimums work, maximums currently ignored - 0 size children may make program hang
Diffstat (limited to 'FL/Fl_Rect.H')
-rw-r--r--FL/Fl_Rect.H11
1 files changed, 11 insertions, 0 deletions
diff --git a/FL/Fl_Rect.H b/FL/Fl_Rect.H
index 29e7fd451..386deb427 100644
--- a/FL/Fl_Rect.H
+++ b/FL/Fl_Rect.H
@@ -88,6 +88,9 @@ public:
void w(int W) { w_ = W; } ///< sets the width
void h(int H) { h_ = H; } ///< sets the height
+ void r(int R) { w_ = R - x_; } ///< sets the width based on R and x
+ void b(int B) { h_ = B - y_; } ///< sets the height based on B and y
+
/** Move all edges in by \p d.
Shrinks the rectangle by \p d at all sides keeping the center of the
@@ -143,6 +146,14 @@ public:
h_ -= (top + bottom);
}
+ friend bool operator==(const Fl_Rect& lhs, const Fl_Rect& rhs) {
+ return (lhs.x_==rhs.x_) && (lhs.y_==rhs.y_) && (lhs.w_==rhs.w_) && (lhs.h_==rhs.h_);
+ }
+
+ friend bool operator!=(const Fl_Rect& lhs, const Fl_Rect& rhs) {
+ return !(lhs==rhs);
+ }
+
}; // class Fl_Rect
#endif // Fl_Rect_H