39 lines
1.3 KiB
Diff
39 lines
1.3 KiB
Diff
From 6305359b3c515e030c2bfd35b6ee62ad36ebe497 Mon Sep 17 00:00:00 2001
|
|
From: Tobias Fella <tobias.fella@kde.org>
|
|
Date: Sun, 27 Aug 2023 01:46:50 +0200
|
|
Subject: [PATCH] Use round instead of ceil in delegatesizehelper
|
|
|
|
Fixes #592
|
|
---
|
|
src/delegatesizehelper.cpp | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/delegatesizehelper.cpp b/src/delegatesizehelper.cpp
|
|
index 7c4d6dec0..aae61fa06 100644
|
|
--- a/src/delegatesizehelper.cpp
|
|
+++ b/src/delegatesizehelper.cpp
|
|
@@ -124,7 +124,7 @@ int DelegateSizeHelper::calculateCurrentPercentageWidth() const
|
|
int maxPercentWidth = endPercentBigger ? m_endPercentWidth : m_startPercentWidth;
|
|
int minPercentWidth = endPercentBigger ? m_startPercentWidth : m_endPercentWidth;
|
|
|
|
- int calcPercentWidth = std::ceil(m * m_parentWidth + c);
|
|
+ int calcPercentWidth = std::round(m * m_parentWidth + c);
|
|
return std::clamp(calcPercentWidth, minPercentWidth, maxPercentWidth);
|
|
}
|
|
|
|
@@ -146,9 +146,9 @@ qreal DelegateSizeHelper::currentWidth() const
|
|
|
|
qreal absoluteWidth = m_parentWidth * percentWidth * 0.01;
|
|
if (m_maxWidth < 0.0) {
|
|
- return std::ceil(absoluteWidth);
|
|
+ return std::round(absoluteWidth);
|
|
} else {
|
|
- return std::ceil(std::min(absoluteWidth, m_maxWidth));
|
|
+ return std::round(std::min(absoluteWidth, m_maxWidth));
|
|
}
|
|
}
|
|
|
|
--
|
|
GitLab
|
|
|