diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-23 12:29:48 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-23 12:18:16 +0100 |
commit | f4b6ff46aea6d260eab191daf5d437dada39f4d0 (patch) | |
tree | dbaa735337d0061958f6219cf1b524efa1c0648c | |
parent | 25e9766e9b87342b6f1b29dc146d5f33e12157a7 (diff) |
lok: take borders into account in in-place Math cursor/selection
The offset is defined by formula's top/left borders (in UI under
Format->Spacing).
Change-Id: Ic17356f8c6e4db3cbe0df765d133ee240f5b088d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143136
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | starmath/source/view.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 8898d10bf5a1..3c7c8b1554d3 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2319,6 +2319,8 @@ std::optional<OString> SmViewShell::getLOKPayload(int nType, int nViewId) const SmCursor& rCursor = GetDoc()->GetCursor(); OutputDevice& rOutDev = const_cast<SmGraphicWidget&>(widget).GetOutputDevice(); tools::Rectangle aCaret = rCursor.GetCaretRectangle(rOutDev); + Point aFormulaDrawPos = widget.GetFormulaDrawPos(); + aCaret.Move(aFormulaDrawPos.X(), aFormulaDrawPos.Y()); LokStarMathHelper helper(SfxViewShell::Current()); tools::Rectangle aBounds = helper.GetBoundingBox(); aCaret.Move(aBounds.Left(), aBounds.Top()); @@ -2336,6 +2338,8 @@ std::optional<OString> SmViewShell::getLOKPayload(int nType, int nViewId) const tools::Rectangle aSelection = rCursor.GetSelectionRectangle(rOutDev); if (!aSelection.IsEmpty()) { + Point aFormulaDrawPos = widget.GetFormulaDrawPos(); + aSelection.Move(aFormulaDrawPos.X(), aFormulaDrawPos.Y()); LokStarMathHelper helper(SfxViewShell::Current()); tools::Rectangle aBounds = helper.GetBoundingBox(); |