Yes here it is
void contract(sf::VertexArray &V,float ExpandValue,char item,int NumberOfVertices)
{
if (V.getVertexCount()==4)
{
V[0].position.x=V[0].position.x+ExpandValue; V[0].position.y=V[0].position.y+ExpandValue;
V[1].position.x=V[1].position.x-ExpandValue; V[1].position.y=V[1].position.y+ExpandValue;
V[2].position.x=V[2].position.x-ExpandValue; V[2].position.y=V[2].position.y-ExpandValue;
V[3].position.x=V[3].position.x+ExpandValue; V[3].position.y=V[3].position.y-ExpandValue;
NewXCenterShape=V[1].position.x-V[0].position.x;
NewYCenterShape=V[2].position.y-V[1].position.y;
...
...
It's the part about the 4 vertices in the center (the rectangle)
And then called the function :
sf::VertexArray CenterObj(sf::Quads,4);
CenterObj[0].position=sf::Vector2f(300,300);
CenterObj[1].position=sf::Vector2f(400,300);
CenterObj[2].position=sf::Vector2f(400,400);
CenterObj[3].position=sf::Vector2f(300,400);
CenterObj[0].texCoords = sf::Vector2f(80.f, 76.f);
CenterObj[1].texCoords = sf::Vector2f(122.f, 76.f);
CenterObj[2].texCoords = sf::Vector2f(122.f, 122.f);
CenterObj[3].texCoords = sf::Vector2f(80.f, 122.f);
...
...
if(event.type==sf::Event::KeyPressed&&event.key.code==sf::Keyboard::C)
{
float ContactValue=1;
contract(CenterObj,ContactValue,'e',4); //here the char variable is not important, it is not used, 'e' can be replaced
..
..