prime31 / Nez

Nez is a free 2D focused framework that works with MonoGame and FNA
MIT License
1.76k stars 355 forks source link

Physics.Overlap rect not right size. #765

Open xThuby opened 1 year ago

xThuby commented 1 year ago

When using Physics.OverlapRectangle() it seems like the rect I give as an argument has to be twice the size of what it needs to be.

I added a Debug.DrawHollowRect to Physics.OverlapRectangle and saw that the _overlapTestBox was about half the size that it should be, when comparing to a debug draw of the rect I'm putting in.

image Red is the rect I'm giving to OverlapRectangle blue is the debug draw I added to the overlap method.

Debug.DrawHollowRect(new RectangleF(rect.Location.X, rect.Location.Y, _overlapTestBox.Width / 2, _overlapTestBox.Height / 2), Color.Blue);