From 8f1108583cf24e7b99733b7535145c6e1b01aac9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 29 Jan 2021 19:55:27 +0100 Subject: [PATCH] Fixed an issue where GuiMsgBox would not look correct on high resolution displays. --- es-core/src/guis/GuiMsgBox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/es-core/src/guis/GuiMsgBox.cpp b/es-core/src/guis/GuiMsgBox.cpp index 6f5e9c2f3..2ccfa2549 100644 --- a/es-core/src/guis/GuiMsgBox.cpp +++ b/es-core/src/guis/GuiMsgBox.cpp @@ -71,7 +71,8 @@ GuiMsgBox::GuiMsgBox(Window* window, const HelpStyle& helpstyle, const std::stri mMsg->setSize(width, 0); // mMsg->getSize.y() now returns the proper length. const float msgHeight = std::max(Font::get(FONT_SIZE_LARGE)->getHeight(), mMsg->getSize().y()*1.225f); - setSize(width + HORIZONTAL_PADDING_PX*2, msgHeight + mButtonGrid->getSize().y()); + setSize(width + HORIZONTAL_PADDING_PX * 2 * Renderer::getScreenWidthModifier(), + msgHeight + mButtonGrid->getSize().y()); // Center for good measure. setPosition((Renderer::getScreenWidth() - mSize.x()) / 2.0f, @@ -107,7 +108,8 @@ void GuiMsgBox::onSizeChanged() mGrid.setRowHeightPerc(1, mButtonGrid->getSize().y() / mSize.y()); // Update messagebox size. - mMsg->setSize(mSize.x() - HORIZONTAL_PADDING_PX*2, mGrid.getRowHeight(0)); + mMsg->setSize(mSize.x() - HORIZONTAL_PADDING_PX * 2 * Renderer::getScreenWidthModifier(), + mGrid.getRowHeight(0)); mGrid.onSizeChanged(); mBackground.fitTo(mSize, Vector3f::Zero(), Vector2f(-32, -32));