Help => Graphics => Topic started by: chaosblasta on June 09, 2017, 01:53:13 pm
Title: Possible Rect<T>.contains() bug?
Post by: chaosblasta on June 09, 2017, 01:53:13 pm
According to documentation, the contains() function is non-inclusive and therefore will return false if the point is located on the edge of the rectangle. This isn't really the case on my tests though..
So with
sf::IntRect rect = {0,0,3,3}; sf::Vector2i point = {0,0};
rect.contains(point) returns true. In fact, every point from (0,0) (2,2) returns true, even though in theory only (1,1) should be true. I may not be understanding the documentation though, and I apologize if this is a mistake on my part.
Title: Re: Possible Rect<T>.contains() bug?
Post by: Laurent on June 09, 2017, 02:09:53 pm
The documentation is obviously wrong, given how this is implemented: