Fix editors launching in the top left corner of the screen
This commit is contained in:
@@ -163,7 +163,8 @@ void init_main_window (sf::RenderWindow & mainPtr, sf::View & mainView) {
|
||||
;
|
||||
|
||||
mainPtr.create(sf::VideoMode(width, height), "Blades of Exile Scenario Editor", sf::Style::Titlebar | sf::Style::Close);
|
||||
mainPtr.setPosition({0,0});
|
||||
sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
|
||||
mainPtr.setPosition({static_cast<int>((desktop.width - width) / 2), static_cast<int>((desktop.height - height) / 2)});
|
||||
|
||||
// Initialize the view
|
||||
mainView.setSize(width, height);
|
||||
|
Reference in New Issue
Block a user