Even if you create a rectangle with the upper-left corner located at (300, 300), the object position is still at (0, 0), because the upper-left corner and the position are two different things.
My advice is to create your rectangle with the upper-left at (0, 0), and then move it.
After that, you just need to set the center at (width / 2, height / 2).
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML rect rotation");
float angle(0.f);
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
if (Event.Type == sf::Event::Closed)
App.Close();
App.Clear();
sf::Shape thing(sf::Shape::Rectangle(0, 0, 500, 500, sf::Color::Green));
thing.SetPosition(300, 300);
thing.SetCenter(250, 250);
thing.Rotate(angle);
angle += 0.1f;
App.Draw(thing);
App.Display();
}
}
By the way, this tricky behavior has been fixed in SFML 2.0, you will only pass width and height parameters to the rectangle shape constructor.