Although I have provided an
answer on your stackexchange question, I'll relay it here too for the benefit of others who may have the same or similar question or need.
SFML views
always rotate around their centre. This, however, does not mean that we can't effectively rotate them around any desired point; it just takes a little extra mathematics...
The basic idea is that you take the offset of the desired target point from the actual centre and rotate this vector (from the centre to the target point) around the view's centre by the amount of rotation you wish to rotate the view. You then need to calculate the difference between those points. You can now rotate the view as normal around the centre but you follow that with a simple move by the difference you just calculated. This makes the point match up to where it was before!
I've added a free function to the SFML wiki that does all this in a little encapsulated function. It takes the point around which you want to rotate the view, the view itself, and the amount of rotation in degrees - all as parameters to the function. The view is manipulated to rotate around that point by your required amount.
Note that a custom view object is required for this approach. If you require applying directly to the window's view, you could modify the function to create a temporary view internally and the set the window's view automatically. Also, you'd need to pass the window instead of a view. However, created your own view (temporary or not) is probably easier
Anyway, the function itself is simply just this:
void rotateViewAt(sf::Vector2f coord, sf::View& view, float rotation)
{
const sf::Vector2f offset{ coord - view.getCenter() };
const float rotationInRadians{ rotation * 3.141592653f / 180.f };
const float sine{ std::sin(rotationInRadians) }; // remember to "#include <cmath>" for this
const float cosine{ std::cos(rotationInRadians) }; // remember to "#include <cmath>" for this
const sf::Vector2f rotatedOffset{ cosine * offset.x - sine * offset.y, sine * offset.x + cosine * offset.y };
view.rotate(rotation);
view.move(offset - rotatedOffset);
}
For more information, see the Wiki page,
Source: Rotate View At (specified co‐ordinate)