From fe1c0c435bb59a1649c342d571efd9896501605d Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Mon, 3 Oct 2005 12:13:58 +0000 Subject: [PATCH] Two fixes involving RtL text drawing git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10513 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/text.C | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6205cd8d9b..2d5d44c6fb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-10-03 Martin Vermeer + + * text.C (cursorX): two fixes involving RtL text drawing + 2005-10-03 Jean-Marc Lasgouttes * text3.C (dispatch): when invoking LFUN_MATH_MACRO with no type diff --git a/src/text.C b/src/text.C index 9f898a515a..6536f40233 100644 --- a/src/text.C +++ b/src/text.C @@ -2127,11 +2127,19 @@ int LyXText::cursorX(CursorSlice const & sl, bool boundary) const // see correction above if (boundary_correction) - if (getFont(par, ppos).isRightToLeft()) + if (getFont(par, ppos).isVisibleRightToLeft()) x -= singleWidth(par, ppos); else x += singleWidth(par, ppos); + // Make sure inside an inset we always count from the left + // edge (bidi!) -- MV + if (sl.pos() < par.size()) { + font = getFont(par, sl.pos()); + if (!boundary && font.isVisibleRightToLeft() + && par.isInset(sl.pos())) + x -= par.getInset(sl.pos())->width(); + } return int(x); }