recenter menu on resize

This commit is contained in:
Josh Holtrop 2012-11-03 09:20:05 -04:00
parent ad3e8a5481
commit 88f644e051

View File

@ -138,6 +138,13 @@ void Client::run_main_menu()
break;
}
break;
case sf::Event::Resized:
m_width = event.size.width;
m_height = event.size.height;
window->SetPosition(sf::Vector2f(
m_width / 2 - window->GetAllocation().width / 2,
m_height / 2 - window->GetAllocation().height / 2));
break;
default:
break;
}