diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2024-01-23 17:34:20 +0100 |
---|---|---|
committer | Marco Cecchetti <marco.cecchetti@collabora.com> | 2024-02-05 18:21:26 +0100 |
commit | 2c4a79c645cc39fb56ff1d5e2b146b718d59088f (patch) | |
tree | e1d93f2db7d9adc6acab936fc25a65b38b047e4e /sc | |
parent | 4dca2db5abc17beb50c7e1de9796e7a7ef38698b (diff) |
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 <hcastro@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162988
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 4f4df882ce83..50d03d010416 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1197,12 +1197,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(); } |