summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-12-14 21:27:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-12-15 11:30:55 +0100
commit56186db93b7777f7b99a8fbfce82b775e24b7695 (patch)
tree0a4a70f87b5d5bf6ed261a3b35eb2bffecf898a2 /vcl
parentd29f057ff03fcbccb81ccbac8d2ae2954ca3daef (diff)
tdf#145934 workaround rounding causing 'dancing characters'
Change-Id: I1fb260196beb0cc54232aa60a1191d3090fa31b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126870 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/text.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 8fb3a2c87118..a28dc49e5ebd 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1348,10 +1348,10 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr,
xDXPixelArray.reset(new DeviceCoordinate[nLen]);
pDXPixelArray = xDXPixelArray.get();
// using base position for better rounding a.k.a. "dancing characters"
- DeviceCoordinate nPixelXOfs = LogicWidthToDeviceCoordinate( rLogicalPos.X() );
+ DeviceCoordinate nPixelXOfs2 = LogicWidthToDeviceCoordinate(rLogicalPos.X() * 2);
for( int i = 0; i < nLen; ++i )
{
- pDXPixelArray[i] = LogicWidthToDeviceCoordinate( rLogicalPos.X() + pDXArray[i] ) - nPixelXOfs;
+ pDXPixelArray[i] = (LogicWidthToDeviceCoordinate((rLogicalPos.X() + pDXArray[i]) * 2) - nPixelXOfs2) / 2;
}
}
else