diff --git a/es-app/src/guis/GuiLaunchScreen.cpp b/es-app/src/guis/GuiLaunchScreen.cpp index edce6e63d..d8e3be7ad 100644 --- a/es-app/src/guis/GuiLaunchScreen.cpp +++ b/es-app/src/guis/GuiLaunchScreen.cpp @@ -192,7 +192,7 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game) // Center on the X axis and keep slightly off-center on the Y axis. setPosition(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.25f); - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); mBackground.setEdgeColor(0xEEEEEEFF); } diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index d0117bed9..dedfb0aad 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -733,7 +733,7 @@ void GuiMetaDataEd::onSizeChanged() mGrid.setColWidthPerc(1, 0.055f); mGrid.setSize(mSize); - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); setPosition((mRenderer->getScreenWidth() - mSize.x) / 2.0f, (mRenderer->getScreenHeight() - mSize.y) / 2.0f); diff --git a/es-app/src/guis/GuiOfflineGenerator.cpp b/es-app/src/guis/GuiOfflineGenerator.cpp index cfc4b941a..841b11c80 100644 --- a/es-app/src/guis/GuiOfflineGenerator.cpp +++ b/es-app/src/guis/GuiOfflineGenerator.cpp @@ -201,7 +201,7 @@ GuiOfflineGenerator::~GuiOfflineGenerator() void GuiOfflineGenerator::onSizeChanged() { - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); // Set row heights. mGrid.setRowHeightPerc(0, mTitle->getFont()->getLetterHeight() * 1.9725f / mSize.y, false); diff --git a/es-app/src/guis/GuiScraperMulti.cpp b/es-app/src/guis/GuiScraperMulti.cpp index 2305924c3..5faff4b03 100644 --- a/es-app/src/guis/GuiScraperMulti.cpp +++ b/es-app/src/guis/GuiScraperMulti.cpp @@ -203,7 +203,7 @@ void GuiScraperMulti::onSizeChanged() mGrid.setColWidthPerc(1, 0.04f); mGrid.setSize(mSize); - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); } void GuiScraperMulti::doNextSearch() diff --git a/es-app/src/guis/GuiScraperSingle.cpp b/es-app/src/guis/GuiScraperSingle.cpp index 0975fc198..d87c8f2b1 100644 --- a/es-app/src/guis/GuiScraperSingle.cpp +++ b/es-app/src/guis/GuiScraperSingle.cpp @@ -158,7 +158,7 @@ void GuiScraperSingle::onSizeChanged() mGrid.setColWidthPerc(1, 0.04f); mGrid.setSize(glm::round(mSize)); - mBackground.fitTo(mSize, glm::vec3 {0.0f, 0.0f, 0.0f}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); // Add some extra margins to the game name. const float newSizeX {mSize.x * 0.96f}; diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index e5c1fdbef..4505bbad0 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -1089,7 +1089,7 @@ void GuiThemeDownloader::onSizeChanged() mGrid.setSize(mSize); mCenterGrid->setSize(glm::vec2 {mSize.x, mSize.y}); mCenterGrid->setPosition(glm::vec3 {0.0f, mGrid.getRowHeight(0) + mGrid.getRowHeight(1), 0.0f}); - mBackground.fitTo(mSize, glm::vec3 {0.0f, 0.0f, 0.0f}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); mScreenshot->setMaxSize(mCenterGrid->getColWidth(1) + mCenterGrid->getColWidth(2) + mCenterGrid->getColWidth(3) + mCenterGrid->getColWidth(4), mCenterGrid->getRowHeight(3)); diff --git a/es-core/src/components/BusyComponent.cpp b/es-core/src/components/BusyComponent.cpp index 86d4796b5..2aeb6150a 100644 --- a/es-core/src/components/BusyComponent.cpp +++ b/es-core/src/components/BusyComponent.cpp @@ -58,7 +58,7 @@ void BusyComponent::onSizeChanged() 16.0f * Renderer::getScreenResolutionModifier()}); mBackground.fitTo(glm::vec2 {mGrid.getColWidth(1) + mGrid.getColWidth(2) + mGrid.getColWidth(3), textHeight + (2.0f * Renderer::getScreenResolutionModifier())}, - mAnimation->getPosition(), glm::vec2 {}); + mAnimation->getPosition(), glm::vec2 {0.0f, 0.0f}); mAnimation->load(&BUSY_ANIMATION_DEF); } diff --git a/es-core/src/components/MenuComponent.cpp b/es-core/src/components/MenuComponent.cpp index fb694acb6..9ab8457bf 100644 --- a/es-core/src/components/MenuComponent.cpp +++ b/es-core/src/components/MenuComponent.cpp @@ -121,7 +121,7 @@ void MenuComponent::updateSize() void MenuComponent::onSizeChanged() { - mBackground.fitTo(mSize, glm::vec3 {0.0f, 0.0f, 0.0f}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); // Update grid row/column sizes. mGrid.setRowHeightPerc(0, TITLE_HEIGHT / mSize.y / 2.0f); diff --git a/es-core/src/components/NinePatchComponent.h b/es-core/src/components/NinePatchComponent.h index 0a05c1ab7..5086b9e5a 100644 --- a/es-core/src/components/NinePatchComponent.h +++ b/es-core/src/components/NinePatchComponent.h @@ -37,7 +37,9 @@ public: void render(const glm::mat4& parentTrans) override; void onSizeChanged() override { buildVertices(); } - void fitTo(glm::vec2 size, glm::vec3 position = {}, glm::vec2 padding = {}); + void fitTo(glm::vec2 size, + glm::vec3 position = {0.0f, 0.0f, 0.0f}, + glm::vec2 padding = {-32.0f, -32.0f}); void setImagePath(const std::string& path); // Apply a color shift to the "edge" parts of the ninepatch. diff --git a/es-core/src/components/TextEditComponent.cpp b/es-core/src/components/TextEditComponent.cpp index a2b25db0a..469a6e6a1 100644 --- a/es-core/src/components/TextEditComponent.cpp +++ b/es-core/src/components/TextEditComponent.cpp @@ -56,7 +56,7 @@ void TextEditComponent::onSizeChanged() return; mBox.fitTo( - mSize, glm::vec3 {}, + mSize, glm::vec3 {0.0f, 0.0f, 0.0f}, glm::vec2 {-34.0f, -32.0f - (TEXT_PADDING_VERT * mRenderer->getScreenHeightModifier())}); onTextChanged(); // Wrap point probably changed. } diff --git a/es-core/src/guis/GuiDetectDevice.cpp b/es-core/src/guis/GuiDetectDevice.cpp index 02bfab86d..bd04b55a3 100644 --- a/es-core/src/guis/GuiDetectDevice.cpp +++ b/es-core/src/guis/GuiDetectDevice.cpp @@ -94,9 +94,8 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun, void GuiDetectDevice::onSizeChanged() { - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); - // Grid. mGrid.setSize(mSize); mGrid.setRowHeightPerc(0, mTitle->getFont()->getHeight() / mSize.y); mGrid.setRowHeightPerc(2, mMsg1->getFont()->getHeight() / mSize.y); diff --git a/es-core/src/guis/GuiInfoPopup.cpp b/es-core/src/guis/GuiInfoPopup.cpp index fafd06883..2116cdf2f 100644 --- a/es-core/src/guis/GuiInfoPopup.cpp +++ b/es-core/src/guis/GuiInfoPopup.cpp @@ -55,7 +55,7 @@ GuiInfoPopup::GuiInfoPopup(std::string message, int duration) setPosition(posX, posY, 0); mFrame->setImagePath(":/graphics/frame.svg"); - mFrame->fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mFrame->fitTo(mSize); addChild(mFrame); // We only initialize the actual time when we first start to render. diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index c5f774cbe..b6b587441 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -306,7 +306,7 @@ void GuiInputConfig::update(int deltaTime) void GuiInputConfig::onSizeChanged() { - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); // Update grid. mGrid.setSize(mSize); diff --git a/es-core/src/guis/GuiMsgBox.cpp b/es-core/src/guis/GuiMsgBox.cpp index 497b92dc5..418c181d7 100644 --- a/es-core/src/guis/GuiMsgBox.cpp +++ b/es-core/src/guis/GuiMsgBox.cpp @@ -174,7 +174,7 @@ void GuiMsgBox::onSizeChanged() mGrid.getRowHeight(0)); mGrid.onSizeChanged(); - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); } void GuiMsgBox::deleteMeAndCall(const std::function& func) diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp index 6f5d7ee74..40b0702d8 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp @@ -304,7 +304,7 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( void GuiTextEditKeyboardPopup::onSizeChanged() { - mBackground.fitTo(mSize, glm::vec3 {0.0f, 0.0f, 0.0f}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); mText->setSize(mSize.x - KEYBOARD_PADDINGX - KEYBOARD_PADDINGX, mText->getSize().y); // Update grid. diff --git a/es-core/src/guis/GuiTextEditPopup.cpp b/es-core/src/guis/GuiTextEditPopup.cpp index 761c36d87..85cdab4dd 100644 --- a/es-core/src/guis/GuiTextEditPopup.cpp +++ b/es-core/src/guis/GuiTextEditPopup.cpp @@ -135,7 +135,7 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle, void GuiTextEditPopup::onSizeChanged() { - mBackground.fitTo(mSize, glm::vec3 {}, glm::vec2 {-32.0f, -32.0f}); + mBackground.fitTo(mSize); mText->setSize(mSize.x - 40.0f * Renderer::getScreenHeightModifier(), mText->getSize().y); // Update grid.