diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-02 11:16:30 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-03 16:41:59 +0200 |
commit | a3daf52dd21ae03a8b04e1f9132a6713c9cc414f (patch) | |
tree | 3da8eac339f92e9a22feb1449db9115e6bf02413 /svx/source/svdraw/svdotext.cxx | |
parent | 387a9c445793e8377f85e508d935dc070fd8ab74 (diff) |
Base scale on 1.0, not on 100.0
Simplifies things by avoiding many repeated multiplications / divisions
by 100 during calculations.
Change-Id: Ib063d343549139c8d83e5b06570dc61f39ea0df6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165666
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx/source/svdraw/svdotext.cxx')
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 526b4d8b0b8e..e66e8ad01459 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -929,8 +929,8 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS tools::Long nXTolMi=nWantWdt/25; // tolerance: -4% tools::Long nXCorr =nWantWdt/20; // correction scale: 5% - double nX = (nWantWdt * 100.0) / double(nIsWdt); // calculate X stretching - double nY = (nWantHgt * 100.0) / double(nIsHgt); // calculate Y stretching + double nX = nWantWdt / double(nIsWdt); // calculate X stretching + double nY = nWantHgt / double(nIsHgt); // calculate Y stretching bool bChkX = true; if (bNoStretching) { // might only be possible proportionally @@ -949,14 +949,14 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS { if (nX < 0.0) nX = -nX; - if (nX < 1.0) + if (nX < 0.01) { - nX = 1.0; + nX = 0.01; bNoMoreLoop = true; } - if (nX > 65535.0) + if (nX > 655.35) { - nX = 65535.0; + nX = 655.35; bNoMoreLoop = true; } @@ -964,14 +964,14 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS { nY = -nY; } - if (nY < 1.0) + if (nY < 0.01) { - nY = 1.0; + nY = 0.01; bNoMoreLoop = true; } - if (nY > 65535.0) + if (nY > 655.35) { - nY = 65535.0; + nY = 655.35; bNoMoreLoop = true; } @@ -1276,7 +1276,7 @@ void SdrTextObj::setupAutoFitText(SdrOutliner& rOutliner, const Size& rTextBoxSi if (fFontScale > 0.0 && fSpacingScale > 0.0 && !mbInEditMode) { - rOutliner.setScalingParameters({ fFontScale, fFontScale, 100.0, fSpacingScale }); + rOutliner.setScalingParameters({ fFontScale, fFontScale, 1.0, fSpacingScale }); } else { |