let's always repaint the row with the cursor in it

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10696 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2006-01-01 23:06:23 +00:00
parent cfcb59904b
commit aa8478b7e5
2 changed files with 16 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2006-01-01 Martin Vermeer <martin.vermeer@hut.fi>
* rowpainter.C (paintPar): always repaint the row with the
cursor in it
2006-01-01 Lars Gullik Bjønnes <larsbj@gullik.net> 2006-01-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* MenuBackend.h: * MenuBackend.h:

View File

@ -729,17 +729,14 @@ lyx::size_type calculateRowSignature(Row const & row, Paragraph const & par)
} }
bool isCursorInInsetInRow(PainterInfo & pi, RowList::const_iterator rit, bool isCursorOnRow(PainterInfo & pi, pit_type pit, RowList::const_iterator rit)
Paragraph const & par)
{ {
InsetList::const_iterator ii = par.insetlist.begin(); LCursor & cur = pi.base.bv->cursor();
InsetList::const_iterator iend = par.insetlist.end(); for (lyx::size_type d = 0; d < cur.depth(); d++)
for ( ; ii != iend; ++ii) { if (cur[d].pit() == pit
if (ii->pos >= rit->pos() && ii->pos < rit->endpos() && cur[d].pos() >= rit->pos()
&& ii->inset->isTextInset() && cur[d].pos() < rit->endpos())
&& pi.base.bv->cursor().isInside(ii->inset))
return true; return true;
}
return false; return false;
} }
@ -767,15 +764,13 @@ void paintPar
// Row signature; has row changed since last paint? // Row signature; has row changed since last paint?
lyx::size_type const row_sig = calculateRowSignature(*rit, par); lyx::size_type const row_sig = calculateRowSignature(*rit, par);
// The following code figures out if the cursor is inside bool cursor_on_row = isCursorOnRow(pi, pit, rit);
// an inset _on this row_.
bool cur_in_inset_in_row = isCursorInInsetInRow(pi, rit, par);
// If selection is on, the current row signature differs from // If selection is on, the current row signature differs from
// from cache, or cursor is inside an inset _on this row_, // from cache, or cursor is inside an inset _on this row_,
// then paint the row // then paint the row
if (repaintAll || par.rowSignature()[rowno] != row_sig if (repaintAll || par.rowSignature()[rowno] != row_sig
|| cur_in_inset_in_row) { || cursor_on_row) {
// Add to row signature cache // Add to row signature cache
par.rowSignature()[rowno] = row_sig; par.rowSignature()[rowno] = row_sig;