mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Removed a lot of unnecessary NinePatchComponent::fitTo() function arguments
This commit is contained in:
parent
a7f84b7404
commit
8bc31e2fd8
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<void()>& func)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue