diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-10 12:15:55 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-19 05:31:51 +0200 |
commit | 2642643ec07cd7f3d28fe558769297578c36de19 (patch) | |
tree | f86a597e9d05e9d3e91f0f9bd4a905d6fbcb5a5f /drawinglayer/source | |
parent | 58e79c4394783033f61e1309214d9060e2f0adf2 (diff) |
tdf#160622: Let SalLayout::GetBoundRect return basegfx::B2DRectangle
This avoids premature rounding in TextLayouterDevice::getTextBoundRect.
The box in D2DWriteTextOutRenderer::performRender needs to be expanded
to allow room for the line width (which now will be guaranteed on all
sides; previously, the rounding could happen to give no room on some
side, even prior to commit 8962141a12c966b2d891829925e6203bf8d51852).
Fixes some lines partially cut off in smaller text (or zoomed out).
Change-Id: I07335136021f894cf045363b4d736bfab06c64d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166236
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/primitive2d/textlayoutdevice.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 1c551ce01363..5145d84ed2b6 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -260,15 +260,9 @@ basegfx::B2DRange TextLayouterDevice::getTextBoundRect(const OUString& rText, sa if (nTextLength) { - ::tools::Rectangle aRect; - + basegfx::B2DRange aRect; mrDevice.GetTextBoundRect(aRect, rText, nIndex, nIndex, nLength); - - // #i104432#, #i102556# take empty results into account - if (!aRect.IsEmpty()) - { - return vcl::unotools::b2DRectangleFromRectangle(aRect); - } + return aRect; } return basegfx::B2DRange(); |