From: Martin Vermeer Date: Mon, 15 Aug 2005 08:26:53 +0000 (+0000) Subject: Fix bidi bugs 1965, 1970 X-Git-Tag: 1.6.10~13964 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a91f7512b2f571efa33df06eaf4ed37a732703b7;p=lyx.git Fix bidi bugs 1965, 1970 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10396 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 47f2ebfe49..d704fad9da 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ + +2005-08-02 Martin Vermeer + + * text.C (cursorX): fix bug 1965: cursor movement at + line end broken in RtL. + (drawSelection): fix bug 1970: drawing of single-line + selection broken for RtL. + 2005-07-31 Jean-Marc Lasgouttes bug 465. diff --git a/src/text.C b/src/text.C index 95e8dccc9d..8726bed96b 100644 --- a/src/text.C +++ b/src/text.C @@ -1898,12 +1898,13 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const X2 = !isRTL(par2) ? endx : 0 + dim_.wid; } - if (!above && !below && &par1.getRow(beg.pos(), end.boundary()) + if (!above && !below && &par1.getRow(beg.pos(), beg.boundary()) == &par2.getRow(end.pos(), end.boundary())) { // paint only one rectangle - pi.pain.fillRectangle(x + x1, y1, X2 - x1, y2 - y1, - LColor::selection); + int const b( !isRTL(par1) ? x + x1 : x + X1 ); + int const w( !isRTL(par1) ? X2 - x1 : x2 - X1 ); + pi.pain.fillRectangle(b, y1, w, y2 - y1, LColor::selection); return; } @@ -2129,7 +2130,10 @@ int LyXText::cursorX(CursorSlice const & sl, bool boundary) const // see correction above if (boundary_correction) - x += singleWidth(par, ppos); + if (getFont(par, ppos).isRightToLeft()) + x -= singleWidth(par, ppos); + else + x += singleWidth(par, ppos); return int(x); }