From e6097b4fb002656281e3b35f2b64760f21bb3132 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 1 Nov 2023 23:38:33 +0100 Subject: [PATCH] Added rounding of the item sizes in GridComponent --- es-core/src/components/primary/GridComponent.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/es-core/src/components/primary/GridComponent.h b/es-core/src/components/primary/GridComponent.h index 7d2b0ef1a..f2bbd4214 100644 --- a/es-core/src/components/primary/GridComponent.h +++ b/es-core/src/components/primary/GridComponent.h @@ -305,11 +305,11 @@ void GridComponent::addEntry(Entry& entry, const std::shared_ptr& item->setLinearInterpolation(mImageLinearInterpolation); item->setMipmapping(true); if (mImagefit == ImageFit::CONTAIN) - item->setMaxSize(mItemSize * mImageRelativeScale); + item->setMaxSize(glm::round(mItemSize * mImageRelativeScale)); else if (mImagefit == ImageFit::FILL) - item->setResize(mItemSize * mImageRelativeScale); + item->setResize(glm::round(mItemSize * mImageRelativeScale)); else if (mImagefit == ImageFit::COVER) - item->setCroppedSize(mItemSize * mImageRelativeScale); + item->setCroppedSize(glm::round(mItemSize * mImageRelativeScale)); item->setCornerRadius(mImageCornerRadius); item->setImage(entry.data.imagePath); if (mImageBrightness != 0.0) @@ -337,11 +337,11 @@ void GridComponent::addEntry(Entry& entry, const std::shared_ptr& mDefaultImage->setLinearInterpolation(mImageLinearInterpolation); mDefaultImage->setMipmapping(true); if (mImagefit == ImageFit::CONTAIN) - mDefaultImage->setMaxSize(mItemSize * mImageRelativeScale); + mDefaultImage->setMaxSize(glm::round(mItemSize * mImageRelativeScale)); else if (mImagefit == ImageFit::FILL) - mDefaultImage->setResize(mItemSize * mImageRelativeScale); + mDefaultImage->setResize(glm::round(mItemSize * mImageRelativeScale)); else if (mImagefit == ImageFit::COVER) - mDefaultImage->setCroppedSize(mItemSize * mImageRelativeScale); + mDefaultImage->setCroppedSize(glm::round(mItemSize * mImageRelativeScale)); mDefaultImage->setCornerRadius(mImageCornerRadius); mDefaultImage->setImage(entry.data.defaultImagePath); if (mImageBrightness != 0.0) @@ -394,11 +394,11 @@ void GridComponent::updateEntry(Entry& entry, const std::shared_ptrsetLinearInterpolation(mImageLinearInterpolation); item->setMipmapping(true); if (mImagefit == ImageFit::CONTAIN) - item->setMaxSize(mItemSize * mImageRelativeScale); + item->setMaxSize(glm::round(mItemSize * mImageRelativeScale)); else if (mImagefit == ImageFit::FILL) - item->setResize(mItemSize * mImageRelativeScale); + item->setResize(glm::round(mItemSize * mImageRelativeScale)); else if (mImagefit == ImageFit::COVER) - item->setCroppedSize(mItemSize * mImageRelativeScale); + item->setCroppedSize(glm::round(mItemSize * mImageRelativeScale)); item->setCornerRadius(mImageCornerRadius); item->setImage(entry.data.imagePath); if (mImageBrightness != 0.0)