summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-04 21:15:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-11-07 18:37:46 +0100
commit495922fd4ac07d4b7c16127b222f1d06a2718399 (patch)
tree0cc3f8a39c6d8b983bfcfa2c434e83e9486114ab
parent4f25551df39c0272f19250e41969e819d9941cdb (diff)
use ResolutionIndependentLayout if there is any MapMode set on the device
Change-Id: Ib9b0589d244c087e08638597692d679e9194c4db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142292 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/outdev/text.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index d5969c7a0092..3e86ab61d19f 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1377,7 +1377,6 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr,
vcl::text::ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nMinIndex, nLen,
nPixelWidth, flags, pLayoutCache);
- bool bHasScaledDXArray(false);
DeviceCoordinate nEndGlyphCoord(0);
std::unique_ptr<double[]> xNaturalDXPixelArray;
if( !pDXArray.empty() )
@@ -1388,7 +1387,6 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr,
{
// convert from logical units to font units without rounding,
// keeping accuracy for lower levels
- bHasScaledDXArray = true;
for (int i = 0; i < nLen; ++i)
xNaturalDXPixelArray[i] = ImplLogicWidthToDeviceSubPixel(pDXArray[i]);
}
@@ -1417,7 +1415,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr,
if( !pSalLayout )
return nullptr;
- pSalLayout->SetTextRenderModeForResolutionIndependentLayout(bHasScaledDXArray);
+ pSalLayout->SetTextRenderModeForResolutionIndependentLayout(mbMap);
// do glyph fallback if needed
// #105768# avoid fallback for very small font sizes
@@ -1432,10 +1430,9 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr,
// position, justify, etc. the layout
pSalLayout->AdjustLayout( aLayoutArgs );
- // default to on for pdf export which uses SubPixelToLogic to convert back to
- // the logical coord space, default off for everything else for now unless
- // a dxarray is provided which has to be scaled
- if (bHasScaledDXArray || meOutDevType == OUTDEV_PDF)
+ // default to on for pdf export, which uses SubPixelToLogic to convert back to
+ // the logical coord space, of if we are scaling/mapping
+ if (mbMap || meOutDevType == OUTDEV_PDF)
pSalLayout->DrawBase() = ImplLogicToDeviceSubPixel(rLogicalPos);
else
{