diff --git a/es-app/src/guis/GuiGameScraper.cpp b/es-app/src/guis/GuiGameScraper.cpp index bcda1e93f..4e4eebf57 100644 --- a/es-app/src/guis/GuiGameScraper.cpp +++ b/es-app/src/guis/GuiGameScraper.cpp @@ -133,9 +133,6 @@ GuiGameScraper::GuiGameScraper(Window* window, static_cast(Renderer::getScreenHeight()) * 0.04f + mButtonGrid->getSize().y + Font::get(FONT_SIZE_MEDIUM)->getHeight() * 8.0f; - // TODO: Temporary hack, see below. - height -= 7.0f * Renderer::getScreenHeightModifier(); - setSize(width, height); setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, (Renderer::getScreenHeight() - mSize.y) / 2.0f); @@ -154,17 +151,11 @@ void GuiGameScraper::onSizeChanged() mSize.y / 2.0f); mGrid.setRowHeightPerc(2, mSystemName->getFont()->getLetterHeight() / mSize.y, false); mGrid.setRowHeightPerc(3, 0.04f, false); - mGrid.setRowHeightPerc(4, ((Font::get(FONT_SIZE_MEDIUM)->getHeight() * 8.0f)) / mSize.y, false); - - // TODO: Replace this temporary hack with a proper solution. There is some kind of rounding - // issue somewhere that causes a small alignment error. This code partly compensates for this - // at higher resolutions than 1920x1080. - if (Renderer::getScreenHeightModifier() > 1.0f) - mSize.y -= 3.0f * Renderer::getScreenHeightModifier(); + mGrid.setRowHeightPerc(4, (Font::get(FONT_SIZE_MEDIUM)->getHeight() * 8.0f) / mSize.y, false); mGrid.setColWidthPerc(1, 0.04f); - mGrid.setSize(mSize); + mGrid.setSize(glm::round(mSize)); mBox.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f}); // Add some extra margins to the game name. diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index c9d4d7b38..7304e6776 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -289,7 +289,7 @@ void ComponentList::render(const glm::mat4& parentTrans) dim.x = (trans[0].x * dim.x + trans[3].x) - trans[3].x; dim.y = (trans[1].y * dim.y + trans[3].y) - trans[3].y; - const int clipRectPosX{static_cast(std::round(trans[3].x))}; + const int clipRectPosX{static_cast(std::ceil(trans[3].x))}; const int clipRectPosY{static_cast(std::round(trans[3].y))}; const int clipRectSizeX{static_cast(std::round(dim.x))}; const int clipRectSizeY{static_cast(std::round(dim.y))}; @@ -383,12 +383,12 @@ void ComponentList::render(const glm::mat4& parentTrans) const float selectedRowHeight = getRowHeight(mEntries.at(mCursor).data); if (opacity == 1) { - Renderer::drawRect(0.0f, mSelectorBarOffset, mSize.x, selectedRowHeight, 0xFFFFFFFF, - 0xFFFFFFFF, false, opacity, trans, + Renderer::drawRect(0.0f, mSelectorBarOffset, std::ceil(mSize.x), selectedRowHeight, + 0xFFFFFFFF, 0xFFFFFFFF, false, opacity, trans, Renderer::Blend::ONE_MINUS_DST_COLOR, Renderer::Blend::ZERO); - Renderer::drawRect(0.0f, mSelectorBarOffset, mSize.x, selectedRowHeight, 0x777777FF, - 0x777777FF, false, opacity, trans, Renderer::Blend::ONE, + Renderer::drawRect(0.0f, mSelectorBarOffset, std::ceil(mSize.x), selectedRowHeight, + 0x777777FF, 0x777777FF, false, opacity, trans, Renderer::Blend::ONE, Renderer::Blend::ONE); } @@ -403,13 +403,13 @@ void ComponentList::render(const glm::mat4& parentTrans) // Draw separators. float y = 0; for (unsigned int i = 0; i < mEntries.size(); i++) { - Renderer::drawRect(0.0f, y, mSize.x, 1.0f * Renderer::getScreenHeightModifier(), 0xC6C7C6FF, - 0xC6C7C6FF, false, opacity, trans); + Renderer::drawRect(0.0f, y, std::ceil(mSize.x), 1.0f * Renderer::getScreenHeightModifier(), + 0xC6C7C6FF, 0xC6C7C6FF, false, opacity, trans); y += getRowHeight(mEntries.at(i).data); } - Renderer::drawRect(0.0f, y, mSize.x, 1.0f * Renderer::getScreenHeightModifier(), 0xC6C7C6FF, - 0xC6C7C6FF, false, opacity, trans); + Renderer::drawRect(0.0f, y, std::ceil(mSize.x), 1.0f * Renderer::getScreenHeightModifier(), + 0xC6C7C6FF, 0xC6C7C6FF, false, opacity, trans); Renderer::popClipRect(); }