PointInRect error (maybe?)
by Phillip O'Shea · in Torque Game Builder · 10/11/2007 (4:36 am) · 0 replies
The current function reads:
Shouldn't it read:
I just added "=" signs to the "pt < point + extent" conditions.
Just a thought
inline bool RectI::pointInRect(const Point2I &pt) const
{
return (pt.x >= point.x && pt.x < point.x + extent.x && pt.y >= point.y && pt.y < point.y + extent.y);
}Shouldn't it read:
inline bool RectI::pointInRect(const Point2I &pt) const
{
return (pt.x >= point.x && pt.x <= point.x + extent.x && pt.y >= point.y && pt.y <= point.y + extent.y);
}I just added "=" signs to the "pt < point + extent" conditions.
Just a thought
About the author
Head of Violent Tulip, a small independent software development company working in Wollongong, Australia. Go to http://www.violent-tulip.com/ to see our latest offerings.