From 8dc23e2114b51a1d177ab25a54945a1716230c1c Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 15 Jan 2021 20:27:54 +0100 Subject: [PATCH] Made BusyComponent scale properly on high resolution displays. --- es-core/src/components/BusyComponent.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/BusyComponent.cpp b/es-core/src/components/BusyComponent.cpp index 456a13b6f..cd924cbe4 100644 --- a/es-core/src/components/BusyComponent.cpp +++ b/es-core/src/components/BusyComponent.cpp @@ -48,7 +48,7 @@ void BusyComponent::onSizeChanged() const float middleSpacerWidth = 0.01f * Renderer::getScreenWidth(); const float textHeight = mText->getFont()->getLetterHeight(); mText->setSize(0, textHeight); - const float textWidth = mText->getSize().x() + 4; + const float textWidth = mText->getSize().x() + (4 * Renderer::getScreenWidthModifier()); mGrid.setColWidthPerc(1, textHeight / mSize.x()); // Animation is square. mGrid.setColWidthPerc(2, middleSpacerWidth / mSize.x()); @@ -56,8 +56,10 @@ void BusyComponent::onSizeChanged() mGrid.setRowHeightPerc(1, textHeight / mSize.y()); - mBackground.fitTo(Vector2f(mGrid.getColWidth(1) + - mGrid.getColWidth(2) + mGrid.getColWidth(3), textHeight + 2), + mBackground.setCornerSize({ 16.0f * Renderer::getScreenWidthModifier(), + 16.0f * Renderer::getScreenHeightModifier() }); + mBackground.fitTo(Vector2f(mGrid.getColWidth(1) + mGrid.getColWidth(2) + + mGrid.getColWidth(3), textHeight + (2 * Renderer::getScreenHeightModifier())), mAnimation->getPosition(), Vector2f(0, 0)); }