Fixed some pixel alignment issues for the carousel.

This commit is contained in:
Leon Styhre 2022-09-05 22:39:26 +02:00
parent b079421205
commit 5d78412b9d
2 changed files with 9 additions and 7 deletions

View file

@ -1147,7 +1147,8 @@ void SystemView::legacyApplyTheme(const std::shared_ptr<ThemeData>& theme)
mPrimary->applyTheme(theme, "system", "textlist_gamelist", ThemeFlags::ALL);
mLegacySystemInfo->setSize(mSize.x, mLegacySystemInfo->getFont()->getLetterHeight() * 2.2f);
mLegacySystemInfo->setPosition(0.0f, mPrimary->getPosition().y + mPrimary->getSize().y);
mLegacySystemInfo->setPosition(0.0f, std::round(mPrimary->getPosition().y) +
std::round(mPrimary->getSize().y));
mLegacySystemInfo->setBackgroundColor(0xDDDDDDD8);
mLegacySystemInfo->setRenderBackground(true);
mLegacySystemInfo->setFont(

View file

@ -498,10 +498,11 @@ template <typename T> void CarouselComponent<T>::render(const glm::mat4& parentT
glm::mat4 carouselTrans {parentTrans};
carouselTrans = glm::translate(
carouselTrans, glm::vec3 {GuiComponent::mPosition.x, GuiComponent::mPosition.y, 0.0f});
carouselTrans =
glm::translate(carouselTrans, glm::vec3 {GuiComponent::mOrigin.x * mSize.x * -1.0f,
GuiComponent::mOrigin.y * mSize.y * -1.0f, 0.0f});
carouselTrans,
glm::round(glm::vec3 {GuiComponent::mPosition.x, GuiComponent::mPosition.y, 0.0f}));
carouselTrans = glm::translate(
carouselTrans, glm::round(glm::vec3 {GuiComponent::mOrigin.x * mSize.x * -1.0f,
GuiComponent::mOrigin.y * mSize.y * -1.0f, 0.0f}));
mRenderer->pushClipRect(
glm::ivec2 {static_cast<int>(glm::clamp(std::round(carouselTrans[3].x), 0.0f,
@ -740,9 +741,9 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
const ThemeData::ThemeElement* elem {theme->getElement(view, element, "carousel")};
mSize.x = Renderer::getScreenWidth();
mSize.y = Renderer::getScreenHeight() * 0.2325f;
mSize.y = Renderer::getScreenHeight() * 0.23240f;
GuiComponent::mPosition.x = 0.0f;
GuiComponent::mPosition.y = floorf(0.5f * (Renderer::getScreenHeight() - mSize.y));
GuiComponent::mPosition.y = Renderer::getScreenHeight() * 0.38378f;
mCarouselColor = 0xFFFFFFD8;
mCarouselColorEnd = 0xFFFFFFD8;
mZIndex = mDefaultZIndex;