From 503ff07d81c372cc2a066b79c3bb22dd44c47fa3 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 7 Sep 2022 19:29:56 +0200 Subject: [PATCH] Fixed an issue where the rating stars would not display properly in the metadata editor and in the scraper. Also fixed a minor rounding issue. --- es-core/src/components/RatingComponent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/RatingComponent.cpp b/es-core/src/components/RatingComponent.cpp index 71b2c8d7c..719902dd6 100644 --- a/es-core/src/components/RatingComponent.cpp +++ b/es-core/src/components/RatingComponent.cpp @@ -108,10 +108,12 @@ void RatingComponent::onSizeChanged() mSize.x = mSize.y * NUM_RATING_STARS; mIconFilled.getTexture()->setSize(mSize.y, mSize.y); + mIconFilled.setTileSize(mSize.y, mSize.y); mIconFilled.setResize(glm::vec2 {std::round(mSize.y * mImageRatio) * NUM_RATING_STARS, mSize.y}, true); mIconUnfilled.getTexture()->setSize(mSize.y, mSize.y); + mIconUnfilled.setTileSize(mSize.y, mSize.y); mIconUnfilled.setResize( glm::vec2 {std::round(mSize.y * mImageRatio) * NUM_RATING_STARS, mSize.y}, true); } @@ -225,7 +227,7 @@ void RatingComponent::applyTheme(const std::shared_ptr& theme, } } - mIconFilled.setTileSize(mSize.y * mImageRatio, mSize.y); + mIconFilled.setTileSize(std::round(mSize.y * mImageRatio), mSize.y); mIconFilled.setResize(glm::vec2 {mSize}, false); if (properties & PATH && elem->has("filledPath") && @@ -241,7 +243,7 @@ void RatingComponent::applyTheme(const std::shared_ptr& theme, mIconFilled.setImage(std::string(":/graphics/star_filled.svg"), true); } - mIconUnfilled.setTileSize(mSize.y * mImageRatio, mSize.y); + mIconUnfilled.setTileSize(std::round(mSize.y * mImageRatio), mSize.y); mIconUnfilled.setResize(glm::vec2 {mSize}, false); if (properties & PATH && elem->has("unfilledPath") &&