As the view size increases (zooming out does this), the co-ordinate range shown on the window increase (in that view).
To lock your image to the size of the window, you can:
- stretch your image to match the new view size, or
- use a separate view for the image that matches the window size.
Maybe something like:
(1)
const sf::Vector2f scale(vecBody.at(0).sprite.getTexture().getSize().x / view.getSize().x, vecBody.at(0).sprite.getTexture().getSize().y / view.getSize().y);
vecBody.at(0).sprite.setScale(scale, scale);
or
(2)
window.setView(sf::View(sf::Vector2f(0, 0), sf::Vector2f(window.getSize())));
window.draw(vecBody.at(0).sprite);
EDIT: removed the sf::View object in (2) and constructed a temporary one inside the setView call.