vcl/source/outdev/text.cxx |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 495922fd4ac07d4b7c16127b222f1d06a2718399
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Nov 4 21:15:53 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Nov 7 18:37:46 2022 +0100

    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 <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

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
     {

Reply via email to