Hi,
please take a look at these 2 functions:
private:
sf::RectangleShape m_shape;
bool getIsMouseHover_A(int x, int y)
{
sf::FloatRect rect = m_shape.getGlobalBounds();
return (x >= rect.left && x < rect.left + rect.width && y >= rect.top && y < rect.top + rect.height);
}
bool getIsMouseHover_B(int x, int y)
{
return (m_shape.getGlobalBounds().contains((float)x, (float)y));
}
While method "_A" works fine the method "_B" does not even compile on my Visual Studio 2017.
The compiler complains about Line #81 in sf::RectInl.
// Compute the real min and max of the rectangle on both axes
T minX = std::min(left, static_cast<T>(left + width));
What`s the reason for this? Did i miss something?
Regards,
Mathias