Use MxGeometry header (#1399)

* Use MxGeometry header

* Fix comment

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
MS
2025-03-11 21:13:13 -04:00
committed by GitHub
parent fbf71990c9
commit d663e26321
27 changed files with 674 additions and 479 deletions

View File

@@ -6,8 +6,8 @@
#include "mxdsfile.h"
#include "mxdsmultiaction.h"
#include "mxdsobject.h"
#include "mxgeometry.h"
#include "mxpresenterlist.h"
#include "mxrect32.h"
#include <assert.h>
@@ -15,6 +15,7 @@
void (*g_omniUserMessage)(const char*, MxS32) = NULL;
// FUNCTION: LEGO1 0x100b6e10
// FUNCTION: BETA10 0x10136970
MxBool GetRectIntersection(
MxS32 p_rect1Width,
MxS32 p_rect1Height,
@@ -35,22 +36,22 @@ MxBool GetRectIntersection(
MxRect32 rect2(MxPoint32(0, 0), MxSize32(p_rect2Width, p_rect2Height));
MxRect32 rect(0, 0, *p_width, *p_height);
rect.AddPoint(rect1Origin);
rect += rect1Origin;
if (!rect.IntersectsWith(rect1)) {
if (!rect.Intersects(rect1)) {
return FALSE;
}
rect.Intersect(rect1);
rect.SubtractPoint(rect1Origin);
rect.AddPoint(rect2Origin);
rect &= rect1;
rect -= rect1Origin;
rect += rect2Origin;
if (!rect.IntersectsWith(rect2)) {
if (!rect.Intersects(rect2)) {
return FALSE;
}
rect.Intersect(rect2);
rect.SubtractPoint(rect2Origin);
rect &= rect2;
rect -= rect2Origin;
*p_rect1Left += rect.GetLeft();
*p_rect1Top += rect.GetTop();