From 653db8249ff01454821f2a2326317f4df9c7ab23 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 24 Jun 2011 01:00:22 +0200 Subject: Pull 2Geom revision 2013 (extra constructors for Rect). (bzr r10347.1.4) --- src/2geom/rect.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/2geom/rect.h b/src/2geom/rect.h index 72b659a81..e9f6cbeb7 100644 --- a/src/2geom/rect.h +++ b/src/2geom/rect.h @@ -71,6 +71,7 @@ public: Rect(Interval const &a, Interval const &b) : Base(a,b) {} /** @brief Create a rectangle from two points. */ Rect(Point const &a, Point const &b) : Base(a,b) {} + Rect(Coord x0, Coord y0, Coord x1, Coord y1) : Base(x0, y0, x1, y1) {} Rect(Base const &b) : Base(b) {} /** @brief Create a rectangle from a range of points. * The resulting rectangle will contain all ponts from the range. @@ -89,6 +90,14 @@ public: Rect result = Rect::from_range(c, c+n); return result; } + static Rect from_xywh(Coord x, Coord y, Coord w, Coord h) { + Rect result = Base::from_xywh(x, y, w, h); + return result; + } + static Rect from_xywh(Point const &o, Point const &dim) { + Rect result = Base::from_xywh(o, dim); + return result; + } /// @} /// @name Inspect dimensions. -- cgit v1.2.3