diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-06-28 15:27:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-06-28 20:34:39 +0200 |
commit | d8963ecd20579a62906eae3ed14d498bf07cbb98 (patch) | |
tree | 5effc1292ad5903aafe1716d057cc8960ce5cf2f /vcl | |
parent | 1eac639c8bd3137f21302b1bcff5c0b45c6c479f (diff) |
tdf#149755 bottom of characters missing in dwrite rendered case
snap bounding box to full pixels
Change-Id: Iecd973e99cec49ee129bad422ae00f558f057abd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136546
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index d76d72c490e9..0e582015adc8 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -238,12 +238,19 @@ bool SalLayout::GetBoundRect(tools::Rectangle& rRect) const // get bounding rectangle of individual glyph if (pGlyph->GetGlyphBoundRect(pGlyphFont, aRectangle)) { - // merge rectangle - aRectangle += Point(aPos.getX(), aPos.getY()); - if (rRect.IsEmpty()) - rRect = aRectangle; - else - rRect.Union(aRectangle); + if (!aRectangle.IsEmpty()) + { + aRectangle.AdjustLeft(std::floor(aPos.getX())); + aRectangle.AdjustRight(std::ceil(aPos.getX())); + aRectangle.AdjustTop(std::floor(aPos.getY())); + aRectangle.AdjustBottom(std::ceil(aPos.getY())); + + // merge rectangle + if (rRect.IsEmpty()) + rRect = aRectangle; + else + rRect.Union(aRectangle); + } bRet = true; } } |