Thanks for taking the time to reply
.
I've tried transforming the mouse to the combined sprites transform but I get the same result (All sprites become selected from a rect of [0, 0, 200, 100] positioned at (0, 0)). All my sprites getTransform() are returning identity transforms for some odd reason. All my sprites are moved by setPosition on initialization.
I am currently trying transform.transformPoint(), and it's giving me weird results but, I can now select each sprite individually but the calculations are off (see attachments for visual representation).
Here is a minimal example of code:
auto sprite = object->getSpriteComponent()->getSprite();
auto spriteTransform = object->getCombinedTransform();
if (sprite.getGlobalBounds().contains(spriteTransform.transformPoint(m_currentMousePosition.x, m_currentMousePosition.y)))
{
object->setSelected(true);
}
else
{
object->setSelected(false);
}
m_currentMousePosition is continuously updated through Qt's widget mouse position which is equivalent to sf::Mouse::getPosition(window).
Any advice, no matter how small is very welcome.