svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit ce17ecbfa6f578debcf8aec9d6c29836adb49c6f Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Apr 30 20:30:08 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun May 1 15:42:28 2022 +0200 ofz#47111 Timeout Change-Id: Ic50978f5189ea2079d8cc2b5d0803ef4baf4ea4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133665 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 9f212299c512..0043b69cd646 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -242,11 +242,11 @@ static void CalculateHorizontalScalingFactor( // skip directly to a small font size if (nFontSize > 128) { - int nEstimatedFinalFontSize = std::ceil(nFontSize * fScalingFactor); - int nFontThth = nFontSize / 1000; - if (nEstimatedFinalFontSize < nFontThth) + double nEstimatedFinalFontSize = nFontSize * fScalingFactor; + double nOnePercentFontSize = nFontSize / 100.0; + if (nEstimatedFinalFontSize < nOnePercentFontSize) { - nFontSize = std::max(16, nFontThth); + nFontSize = std::max<int>(16, std::ceil(5 * nEstimatedFinalFontSize)); SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight()); } }