From 089398e51409458c5438c49fb347e4f09d9c09dc Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 18 Apr 2024 13:18:37 +0500 Subject: 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 --- editeng/source/items/svxfont.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'editeng') diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index a4367de4680e..db229190a403 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -38,7 +38,7 @@ static tools::Long GetTextArray( const OutputDevice* pOut, const OUString& rStr, { const SalLayoutGlyphs* layoutGlyphs = SalLayoutGlyphsCache::self()->GetLayoutGlyphs(pOut, rStr, nIndex, nLen); - return pOut->GetTextArray( rStr, pDXAry, nIndex, nLen, true, nullptr, layoutGlyphs); + return basegfx::fround(pOut->GetTextArray( rStr, pDXAry, nIndex, nLen, true, nullptr, layoutGlyphs)); } SvxFont::SvxFont() @@ -719,7 +719,7 @@ void SvxDoGetCapitalSize::Do( const OUString &_rTxt, const sal_Int32 _nIdx, if (pDXAry) { KernArray aKernArray; - aPartSize.setWidth(pOut->GetTextArray(_rTxt, &aKernArray, _nIdx, _nLen)); + aPartSize.setWidth(basegfx::fround(pOut->GetTextArray(_rTxt, &aKernArray, _nIdx, _nLen))); assert(pDXAry->get_factor() == aKernArray.get_factor()); auto& dest = pDXAry->get_subunit_array(); sal_Int32 nStart = dest.empty() ? 0 : dest.back(); -- cgit LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2020-10-21gitmodules: use relative pathsChristian Lohmaier
2020-10-01use https://git.libreoffice.org/$repo as canonical URL for submodulesChristian Lohmaier
2018-12-20uset https:// instead of git:// for submodulesChristian Lohmaier