OK, I solved this problem by getting my mouse position from game state, not from the button's parent class.
Now my code looks like this:
if mouse is on a button:
bool SomeText::isMouseInvaded(sf::Vector2i mouse_position)
{
if ( mouse_position.x >= this->text.getPosition().x - textRect.width / 2 &&
mouse_position.x <= this->text.getPosition().x + textRect.width / 2 &&
mouse_position.y >= this->text.getPosition().y - textRect.height / 2 &&
mouse_position.y <= this->text.getPosition().y + textRect.height / 2 &&
this->if_halfed ) return true; //if_halfed means if origin is set in the middle or in the top-left corner
else if ( mouse_position.x >= this->text.getPosition().x &&
mouse_position.x <= this->text.getPosition().x + textRect.width &&
mouse_position.y >= this->text.getPosition().y + textRect.top &&
mouse_position.y <= this->text.getPosition().y + textRect.height + textRect.top &&
!this->if_halfed) return true;
else return false;
}
and a fragment from function checking that event:
if (this->things["QUIT_BUTTON"]->isClicked_Left(mPosWindow)) // quitting the game
this->quit = true;