refactor search result overlay painting

This commit is contained in:
mae
2009-12-02 10:57:05 +01:00
parent 44ade7c475
commit b440068d4d
3 changed files with 76 additions and 72 deletions

View File

@@ -61,6 +61,8 @@ void TextEditorOverlay::setVisible(bool b)
void TextEditorOverlay::clear()
{
if (m_selections.isEmpty())
return;
m_selections.clear();
update();
}
@@ -90,7 +92,10 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end,
selection.m_dropShadow = dropShadow;
m_selections += selection;
if (dropShadow)
m_selections.append(selection);
else
m_selections.prepend(selection);
update();
}