From aaa274245a584c633dcfdb5444bbc1dc21c0c28f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 Apr 2016 21:17:16 +0300 Subject: Add copy constructor into Rect. --- src/gui/rect.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gui/rect.h') diff --git a/src/gui/rect.h b/src/gui/rect.h index 34f333cfc..240d4ce44 100644 --- a/src/gui/rect.h +++ b/src/gui/rect.h @@ -91,6 +91,23 @@ class Rect notfinal */ Rect(const int x, const int y, const int width, const int height); + Rect(const Rect &r) : + x(r.x), + y(r.y), + width(r.width), + height(r.height) + { + } + + Rect &operator=(const Rect &r) + { + x = r.x; + y = r.y; + width = r.width; + height = r.height; + return *this; + } + virtual ~Rect() { } -- cgit v1.2.3-60-g2f50