Add GetPoint

This commit is contained in:
Christian Semmler
2023-10-19 09:19:23 -04:00
parent 26bde7a03d
commit 27e064e69d
2 changed files with 6 additions and 6 deletions

View File

@@ -43,6 +43,8 @@ public:
inline MxS32 GetWidth() { return (m_right - m_left) + 1; } inline MxS32 GetWidth() { return (m_right - m_left) + 1; }
inline MxS32 GetHeight() { return (m_bottom - m_top) + 1; } inline MxS32 GetHeight() { return (m_bottom - m_top) + 1; }
inline MxPoint32 GetPoint() { return MxPoint32(this->m_left, this->m_top); }
}; };
#endif // MXRECT32_H #endif // MXRECT32_H

View File

@@ -37,7 +37,7 @@ void MxRegion::Reset()
void MxRegion::vtable18(MxRect32 &p_rect) void MxRegion::vtable18(MxRect32 &p_rect)
{ {
MxRect32 rectCopy( MxRect32 rectCopy(
MxPoint32(p_rect.m_left, p_rect.m_top), p_rect.GetPoint(),
MxSize32(p_rect.m_right, p_rect.m_bottom) MxSize32(p_rect.m_right, p_rect.m_bottom)
); );
MxRegionListCursor cursor(m_list); MxRegionListCursor cursor(m_list);
@@ -49,19 +49,17 @@ void MxRegion::vtable18(MxRect32 &p_rect)
break; break;
if (topBottom->m_top >= rectCopy.m_bottom) { if (topBottom->m_top >= rectCopy.m_bottom) {
MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(rectCopy); cursor.Prepend(new MxRegionTopBottom(rectCopy));
cursor.Prepend(newTopBottom);
rectCopy.m_top = rectCopy.m_bottom; rectCopy.m_top = rectCopy.m_bottom;
} }
else if (rectCopy.m_top < topBottom->m_bottom) { else if (rectCopy.m_top < topBottom->m_bottom) {
if (rectCopy.m_top < topBottom->m_top) { if (rectCopy.m_top < topBottom->m_top) {
MxRect32 topBottomRect( MxRect32 topBottomRect(
MxPoint32(rectCopy.m_left, rectCopy.m_top), rectCopy.GetPoint(),
MxSize32(rectCopy.m_right, topBottom->m_top) MxSize32(rectCopy.m_right, topBottom->m_top)
); );
MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(topBottomRect); cursor.Prepend(new MxRegionTopBottom(topBottomRect));
cursor.Prepend(newTopBottom);
rectCopy.m_top = topBottom->m_top; rectCopy.m_top = topBottom->m_top;
} }
else if (topBottom->m_top < rectCopy.m_top) { else if (topBottom->m_top < rectCopy.m_top) {