diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-18 13:18:37 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-20 08:53:26 +0200 |
commit | 089398e51409458c5438c49fb347e4f09d9c09dc (patch) | |
tree | f9bd3b85a2f3153db57696a68a9a9e48efd8c139 /toolkit | |
parent | 7b1405689d4246e0e37e8759f03e1962af964cec (diff) |
Return double from OutputDevice::GetTextArray
And introduce GetTextWidth / GetTextHeight variants returning double.
It allows to avoid premature rounding.
At least in one case - testTdf145111_anchor_in_Fontwork - it allowed
to make the test DPI-independent (at least in my testing on Windows,
using 125, 150, and 175% UI scaling).
Change-Id: I973d2c729ec6bb7114b4f99b9027f1ead7c1d061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166237
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxfont.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index 01e7aaae7944..47fad780d73b 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -153,7 +153,7 @@ sal_Int32 VCLXFont::getStringWidthArray( const OUString& str, css::uno::Sequence vcl::Font aOldFont = pOutDev->GetFont(); pOutDev->SetFont( maFont ); KernArray aDXA; - nRet = pOutDev->GetTextArray( str, &aDXA ); + nRet = basegfx::fround(pOutDev->GetTextArray(str, &aDXA)); rDXArray.realloc(aDXA.size()); sal_Int32* pArray = rDXArray.getArray(); for (size_t i = 0, nLen = aDXA.size(); i < nLen; ++i) |