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); }