Problem with RectangleF.Contains

BrianRiceBrianRice USMember ✭✭

The only difference in these two tests is 84.55808f vs 84.5f in the width of the two inner rectangles.

Yet contains ends up being false while contains2 ends up being true. Wow.

Can anybody verify this? And if so can anybody identify the problem?

Thanks!

RectangleF r1 = new RectangleF (119.221f, -122.9433f, 646f, 646f);
RectangleF r2 = new RectangleF (238.4419f, 0f, 84.55808f, 77.11342f);
bool contains = r1.Contains (r2);
``
RectangleF r3 = new RectangleF (119.221f, -122.9433f, 646f, 646f);
RectangleF r4 = new RectangleF (238.4419f, 0f, 84.5f, 77.11342f);
bool contains2 = r3.Contains (r4);

Posts

Sign In or Register to comment.