sfx2/source/control/recentdocsviewitem.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b70d17b08a7f24e4c470831910e63493082e0874
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Mar 15 11:13:09 2022 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Mar 15 10:12:07 2022 +0100

    Round calculation to avoid blurry default icons
    
    Having the paper of 21000 x 29700, and nThumbnailSize of 256, the
    ratio is 0.0086195286195286195; aThumbnailSize would be calculated
    from 255.99999999999999915 x 181.0101010101010095; truncation will
    make the end result 255 x 181, and after drawing the icon on that,
    it will be stretched to 256x256 (so there will be 255->256 scale).
    
    Change-Id: Ic7d37206b42e2229b36161c215a36e4b71486802
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131582
    Tested-by: Mike Kaganski <mike.kagan...@collabora.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index 6f046e3dc6e8..5741f59b2108 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -81,7 +81,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
&rView, const OUStri
             nPaperWidth = aInfo.getWidth();
         }
         double ratio = double(nThumbnailSize) / double(std::max(nPaperHeight, 
nPaperWidth));
-        Size aThumbnailSize(nPaperWidth * ratio, nPaperHeight * ratio);
+        Size aThumbnailSize(std::round(nPaperWidth * ratio), 
std::round(nPaperHeight * ratio));
 
         if (aExtSize.Width() > aThumbnailSize.Width() || aExtSize.Height() > 
aThumbnailSize.Height())
         {

Reply via email to