summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-11-19 15:07:03 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-11-19 16:37:17 +0200
commitd35b5c8db00afb0316b7ae4c43126a5dad194cbb (patch)
tree30d5386675031952f739e94cf7f7aa55da245649
parent9ead6f58501f29ee690cc44195fd5bf229dfbb7d (diff)
tdf#103891: Fix DX array calculation
This partially reverts: commit c49d5dea164b09b05a898495fa2dd48b7ca4f0e4 Author: Khaled Hosny <khaledhosny@eglug.org> Date: Fri Nov 11 18:24:11 2016 +0200 tdf#103765: Minimize the effect of rounding to int Instead of scaling the relative coordinates and accumulating rounding errors, scale the absolute coordinates. Also round to int instead of truncating. as it results in OutputDevice::GetTextArray() calculating wrong absolute DX array. Again the whole DX array thing is brain dead. Change-Id: Ia257b73062315b797b5ed52e434562fad3b3fb90
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 9ad19679056a..b9240e74f87c 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -595,11 +595,13 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
nYOffset = -pHbPositions[i].y_offset;
}
- Point aNewPos(lround((aCurrPos.X() + nXOffset) * nXScale),
- lround((aCurrPos.Y() + nYOffset) * nYScale));
+ nAdvance *= nXScale;
+ nXOffset *= nXScale;
+ nYOffset *= nYScale;
+
+ Point aNewPos(aCurrPos.X() + nXOffset, aCurrPos.Y() + nYOffset);
const GlyphItem aGI(nCharPos, nGlyphIndex, aNewPos, nGlyphFlags,
- lround(nAdvance * nXScale),
- lround(nXOffset * nXScale));
+ nAdvance, nXOffset);
AppendGlyph(aGI);
aCurrPos.X() += nAdvance;