Add MxSize32, match MxRegion ctor

This commit is contained in:
Christian Semmler
2023-10-18 18:21:49 -04:00
parent ab81adf774
commit 85c6a0b049
3 changed files with 51 additions and 10 deletions

View File

@@ -1,6 +1,9 @@
#ifndef MXRECT32_H
#define MXRECT32_H
#include "mxpoint32.h"
#include "mxsize32.h"
class MxRect32
{
public:
@@ -13,20 +16,33 @@ public:
this->m_bottom = p_bottom;
}
MxRect32(const MxPoint32 &p_point, const MxSize32 &p_size)
{
this->m_left = p_point.m_x;
this->m_top = p_point.m_y;
this->m_right = p_size.m_width;
this->m_bottom = p_size.m_height;
}
MxS32 m_left;
MxS32 m_top;
MxS32 m_right;
MxS32 m_bottom;
inline MxS32 GetWidth()
inline void SetPoint(const MxPoint32 &p_point)
{
return (m_right - m_left) + 1;
this->m_left = p_point.m_x;
this->m_top = p_point.m_y;
}
inline MxS32 GetHeight()
inline void SetSize(const MxSize32 &p_size)
{
return (m_bottom - m_top) + 1;
this->m_right = p_size.m_width;
this->m_bottom = p_size.m_height;
}
inline MxS32 GetWidth() { return (m_right - m_left) + 1; }
inline MxS32 GetHeight() { return (m_bottom - m_top) + 1; }
};
#endif // MXRECT32_H