Improved font rendering for BusyComponent and GuiInfoPopup

This commit is contained in:
Leon Styhre 2023-07-29 20:27:36 +02:00
parent 8a42b01165
commit 40f258f0f4
2 changed files with 4 additions and 3 deletions

View file

@ -43,7 +43,7 @@ void BusyComponent::onSizeChanged()
mGrid.setColWidthPerc(2, middleSpacerWidth / mSize.x);
mGrid.setColWidthPerc(3, textWidth / mSize.x);
mGrid.setRowHeightPerc(1, textHeight / std::round(mSize.y));
mGrid.setRowHeightPerc(1, mText->getFont()->getLetterHeight() / mSize.y);
mBackground.setCornerSize({16.0f * Renderer::getScreenResolutionModifier(),
16.0f * Renderer::getScreenResolutionModifier()});

View file

@ -61,9 +61,10 @@ GuiInfoPopup::GuiInfoPopup(std::string message, int duration)
// We only initialize the actual time when we first start to render.
mStartTime = 0;
mGrid = new ComponentGrid(glm::ivec2 {1, 1});
mGrid = new ComponentGrid(glm::ivec2 {1, 3});
mGrid->setEntry(s, glm::ivec2 {0, 1}, false, true);
mGrid->setRowHeightPerc(1, s->getSize().y / mSize.y);
mGrid->setSize(mSize);
mGrid->setEntry(s, glm::ivec2 {0, 0}, false, true);
addChild(mGrid);
}