Make some constants float to prevent extra casting work
This commit is contained in:
parent
7c1bf48ab0
commit
e428509e0a
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user