X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2FCRect.cpp;h=acbcc27e30b3b7bb51a46089a5c168f1d88654a1;hb=9a9053e91df6e08761e2ce72be350c5c2233153b;hp=34013b1cbfa73f17296ebac9014535322144a485;hpb=73872ce04c3759b35e010af9c16367bc57a14d38;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/CRect.cpp b/Usermode/Applications/axwin4_src/Server/CRect.cpp index 34013b1c..acbcc27e 100644 --- a/Usermode/Applications/axwin4_src/Server/CRect.cpp +++ b/Usermode/Applications/axwin4_src/Server/CRect.cpp @@ -7,6 +7,7 @@ */ #include #include +#include namespace AxWin { @@ -26,6 +27,14 @@ void CRect::Move(int NewX, int NewY) m_y2 = m_y + m_h; } +void CRect::Resize(int NewW, int NewH) +{ + m_w = NewW; + m_h = NewH; + m_x2 = m_x + m_w; + m_y2 = m_y + m_h; +} + bool CRect::HasIntersection(const CRect& other) const { // If other's origin is past our far corner @@ -49,10 +58,10 @@ CRect CRect::Intersection(const CRect& other) const int x2 = ::std::min(m_x2, other.m_x2); int y2 = ::std::min(m_y2, other.m_y2); - if( x1 <= x2 || y2 <= y1 ) + if( x2 <= x1 || y2 <= y1 ) return CRect(); - return CRect(x1, y1, x2-x1, y2-y2); + return CRect(x1, y1, x2-x1, y2-y1); } CRect CRect::RelativeIntersection(const CRect& area)