X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Frect.h;h=018844696b5ef289280f7ed6f778deb59345216f;hp=25ef94e7a3955c80f393618ab54d71d7fa2ae45f;hb=6c0dfe752994312ee58d307b383948bfeb2d6e2e;hpb=326f04a375ce3120f7e8957e3d7cd5f296f513e3 diff --git a/src/rect.h b/src/rect.h index 25ef94e..0188446 100644 --- a/src/rect.h +++ b/src/rect.h @@ -12,6 +12,7 @@ namespace IPDF T x; T y; T w; T h; //TRect() = default; // Needed so we can fread/fwrite this struct TRect(T _x=0, T _y=0, T _w=1, T _h=1) : x(_x), y(_y), w(_w), h(_h) {} + template TRect(const TRect & cpy) : x(T(cpy.x)), y(T(cpy.y)), w(T(cpy.w)), h(T(cpy.h)) {} std::string Str() const { @@ -38,7 +39,16 @@ namespace IPDF return true; } - template TRect Convert() {return TRect(B(x), B(y), B(w), B(h));} + template TRect Convert() const {return TRect(B(x), B(y), B(w), B(h));} + + template TRect & operator=(const TRect & equ) + { + x = T(equ.x); + y = T(equ.y); + w = T(equ.w); + h = T(equ.h); + return *this; + } };