Not sure that's what's happening because you didn't post a picture of the problem, but if the top left corner of your text is at the center of your rectangle, then it can be because you didn't set a font/string/size to your sf::Text before using its bounds. (its width and height would be 0)