Fix editors launching in the top left corner of the screen

This commit is contained in:
2020-02-23 23:29:44 -05:00
parent 19250e9b94
commit 3ba6266cd4
2 changed files with 4 additions and 2 deletions

View File

@@ -143,7 +143,8 @@ void init_main_window (sf::RenderWindow& mainPtr, sf::View& mainView) {
; ;
mainPtr.create(sf::VideoMode(width, height), "Blades of Exile Character Editor", sf::Style::Titlebar | sf::Style::Close); mainPtr.create(sf::VideoMode(width, height), "Blades of Exile Character 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 // Initialize the view
mainView.setSize(width, height); mainView.setSize(width, height);

View File

@@ -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.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 // Initialize the view
mainView.setSize(width, height); mainView.setSize(width, height);