Make some constants float to prevent extra casting work

This commit is contained in:
Pedro Gimeno 2020-07-20 15:59:41 +02:00 committed by Gitea
parent 7c1bf48ab0
commit e428509e0a
3 changed files with 6 additions and 6 deletions

View File

@ -118,8 +118,8 @@ void PauseMenuState::onGuiScaleChanged(const GuiScaleChangedEvent &event) {
void PauseMenuState::updateWidgetPosition() {
m_menuWidget.setPosition(
roundf(Config::screenWidth / 2.0 - m_menuWidget.getGlobalBounds().sizeX / 2.0),
roundf(Config::screenHeight / 2.0 - m_menuWidget.getGlobalBounds().sizeY / 2.0)
roundf(Config::screenWidth / 2.0f - m_menuWidget.getGlobalBounds().sizeX / 2.0f),
roundf(Config::screenHeight / 2.0f - m_menuWidget.getGlobalBounds().sizeY / 2.0f)
);
}

View File

@ -127,12 +127,12 @@ void SettingsMenuState::updateWidgetPosition() {
m_doneButton.setPosition(
roundf(Config::screenWidth / 2.0f - m_doneButton.getGlobalBounds().sizeX / 2.0f),
roundf(Config::screenHeight - bottomBorderSize / 2.0f - m_doneButton.getGlobalBounds().sizeY / 2.0)
roundf(Config::screenHeight - bottomBorderSize / 2.0f - m_doneButton.getGlobalBounds().sizeY / 2.0f)
);
m_menuWidget.setPosition(
roundf(Config::screenWidth / 2.0 - m_menuWidget.getGlobalBounds().sizeX / 2.0),
roundf(topBorderSize + 5 * Config::guiScale)
roundf(Config::screenWidth / 2.0f - m_menuWidget.getGlobalBounds().sizeX / 2.0f),
roundf(topBorderSize + 5.0f * Config::guiScale)
);
}

View File

@ -164,7 +164,7 @@ void TitleScreenState::updateWidgetPosition() {
m_titleText.setPosition(
roundf(Config::screenWidth / 2.0f - m_titleText.getSize().x * m_titleText.getScale().x / 2.0f),
roundf(0.04 * Config::screenHeight * Config::guiScale)
roundf(0.04f * Config::screenHeight * Config::guiScale)
);
m_versionText.setPosition(Config::guiScale, Config::screenHeight - m_versionText.getSize().y * Config::guiScale);
m_copyrightText.setPosition(