Honor boundary when asking for cursorX in drawSelection code

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10315 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2005-07-18 09:18:02 +00:00
parent f9e6eb2285
commit dda0ab085c
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2005-07-18 Juergen Vigna <jug@lyx.org>
* text.C (drawSelection): honor boundary when asking for cursorX.
2005-07-17 José Matos <jamatos@fc.up.pt>
* tabular.C (recalculateMulticolumns): fix handling of one column

View File

@ -1891,7 +1891,7 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const
Row const & row1 = par1.getRow(beg.pos(), beg.boundary());
y1 = bv_funcs::getPos(beg, beg.boundary()).y_ - row1.ascent();
y2 = y1 + row1.height();
int const startx = cursorX(beg.top(), false);
int const startx = cursorX(beg.top(), beg.boundary());
x1 = !isRTL(par1) ? startx : 0;
x2 = !isRTL(par1) ? 0 + dim_.wid : startx;
}
@ -1906,7 +1906,7 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const
Row const & row2 = par2.getRow(end.pos(), end.boundary());
Y1 = bv_funcs::getPos(end, end.boundary()).y_ - row2.ascent();
Y2 = Y1 + row2.height();
int const endx = cursorX(end.top(), false);
int const endx = cursorX(end.top(), end.boundary());
X1 = !isRTL(par2) ? 0 : endx;
X2 = !isRTL(par2) ? endx : 0 + dim_.wid;
}
@ -1920,6 +1920,10 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const
return;
}
lyxerr[Debug::DEBUG] << " y1: " << y1 << " y2: " << y2
<< "X1:" << X1 << " x2: " << X2 << " wid: " << dim_.wid
<< endl;
// paint upper rectangle
pi.pain.fillRectangle(x + x1, y1, x2 - x1, y2 - y1,
LColor::selection);