sc/source/ui/view/gridwin4.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 7556f924bc270497abe24f2e194fcc458b255781 Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Tue Jan 23 17:34:20 2024 +0100 Commit: Marco Cecchetti <marco.cecche...@collabora.com> CommitDate: Thu Jan 25 13:55:21 2024 +0100 lok: calc: rtl - misplaced caret This is a workaround since text cursor is horizontally a few pixels misplaced wrt text in the RTL case. This issue is a regression from https://gerrit.libreoffice.org/c/core/+/162196 Change-Id: Ia06ee223d01a7df8841bfaca3cad32af896871d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162563 Reviewed-by: Henry Castro <hcas...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 368d92320df0..63d279dd57d2 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1194,12 +1194,14 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // same zoom level as view used for painting aNewOutputArea = rDevice.LogicToPixel(aOrigOutputAreaTw); } + // a small workaround for getting text position matching cursor position horizontally. + const tools::Long nCursorGapPx = 2; // Transform the cell range X coordinates such that the edit cell area is // horizontally mirrored w.r.t the (combined-)tile. aNewOutputArea = tools::Rectangle( pLokRTLCtxt->docToTilePos(aNewOutputArea.Left() - aOriginAbsPx.X()) + aOriginAbsPx.X(), aNewOutputArea.Top(), - pLokRTLCtxt->docToTilePos(aNewOutputArea.Right() - aOriginAbsPx.X()) + aOriginAbsPx.X(), + pLokRTLCtxt->docToTilePos(aNewOutputArea.Right() - aOriginAbsPx.X()) + aOriginAbsPx.X() + nCursorGapPx, aNewOutputArea.Bottom()); aNewOutputArea.Normalize(); }