PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Possible Bug in isPointInRect()?

summer_goth · 04 Dec 2006, 19:29 UTC
Hi there,

I have realized that when I create a rectangle isPointInRect() will return true even though it is false.

For instance:

Code:
testRect.setRect(116,220,204,235);


This rectangle will always return true when using isPointInRect() when the point's y is within the rect but the x is bigger than what it is in the rect.

The point (220,230) will return true even though it is not within the rectangle.

Code:
testRect.isPointInRect(p.x,p.y);
returns true when p is (220,230) or in fact when p.x is any number larger than 116. The y coordinate seems to work fine though.

Is this a bug or am I doing something wrong?

Thanks guys.

Edit: The y coordinate does not work either. If p.y is bigger than the y in the rect but the x is correct then it will also return true even though it isn't.
Hi summer_goth,

I'm afraid to say that you are right.
We are fixing it right now. Tomorrow we'll upload a new version with that bug fixed (and some other bugs fixed too).

Best regards,
Sergio.
summer_goth · 05 Dec 2006, 16:37 UTC
Thank you very much Sergio. :)
Hi summer_goth,

We've uploaded a new version of GledPlay (b253) with a couple of bug fixes, including the one you've found.

As usual, you can download it here:
http://www.gledplay.com

Thank you very much for your bug report, we really appreciate it.

Best regards,
Sergio.