mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
simplify selected text painting.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24769 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2cf301033e
commit
ffc1002291
@ -243,10 +243,7 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// selected text?
|
// selected text?
|
||||||
pit_type const p0 = pi_.base.bv->cursor().selBegin().pit();
|
bool const selection = pos >= row_.sel_beg && pos < row_.sel_end;
|
||||||
bool selection = row_.sel_beg > -1 && row_.sel_beg != row_.sel_end
|
|
||||||
&& ((pit_ == p0 && (pos >= row_.sel_beg && pos < row_.sel_end))
|
|
||||||
|| (pit_ > p0 && pos < row_.sel_end));
|
|
||||||
|
|
||||||
// collect as much similar chars as we can
|
// collect as much similar chars as we can
|
||||||
for (++vpos ; vpos < end ; ++vpos) {
|
for (++vpos ; vpos < end ; ++vpos) {
|
||||||
@ -254,8 +251,8 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
|
|||||||
if (pos < font_span.first || pos > font_span.last)
|
if (pos < font_span.first || pos > font_span.last)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (row_.sel_beg > -1 && row_.sel_beg != row_.sel_end &&
|
bool const new_selection = pos >= row_.sel_beg && pos < row_.sel_end;
|
||||||
((pit_ == p0 && pos == row_.sel_beg) || pos == row_.sel_end))
|
if (selection != new_selection)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (prev_change != par_.lookupChange(pos).type)
|
if (prev_change != par_.lookupChange(pos).type)
|
||||||
|
Loading…
Reference in New Issue
Block a user