diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-03-15 11:13:09 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-03-15 10:12:07 +0100 |
commit | b70d17b08a7f24e4c470831910e63493082e0874 (patch) | |
tree | 46bd529193b5faf9a85fd9976667630ec90347be /sfx2 | |
parent | d0c2c78725f5f50e3f2d08b3495cda6ec03b4297 (diff) |
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.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/recentdocsviewitem.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
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()) { |