From dda0ab085c777492f0b46fe69696af9d3518ad17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Mon, 18 Jul 2005 09:18:02 +0000 Subject: [PATCH] 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 --- src/ChangeLog | 4 ++++ src/text.C | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index da50edbf3a..2ee30da2a4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-07-18 Juergen Vigna + + * text.C (drawSelection): honor boundary when asking for cursorX. + 2005-07-17 José Matos * tabular.C (recalculateMulticolumns): fix handling of one column diff --git a/src/text.C b/src/text.C index e4f85e7532..abeebe3a51 100644 --- a/src/text.C +++ b/src/text.C @@ -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); -- 2.39.2