Browse Source

fix no visible line case

pull/974/head
krepa098 11 years ago
parent
commit
a0a56e32a0
  1. 18
      src/chatlog/chatlog.cpp

18
src/chatlog/chatlog.cpp

@ -192,15 +192,15 @@ void ChatLog::partialUpdate() @@ -192,15 +192,15 @@ void ChatLog::partialUpdate()
{
repos = false;
if(!visibleLines.empty())
{
repos = layout(visibleLines.first()->getRowIndex(), visibleLines.last()->getRowIndex(), useableWidth());
}
checkVisibility();
}
while(repos);
reposition(visibleLines.last()->getRowIndex(), lines.size());
if(!visibleLines.empty())
reposition(visibleLines.last()->getRowIndex(), lines.size());
checkVisibility();
setViewportUpdateMode(oldUpdateMode);
@ -530,7 +530,14 @@ void ChatLog::checkVisibility() @@ -530,7 +530,14 @@ void ChatLog::checkVisibility()
});
if(upperBound == lines.end())
upperBound = lines.begin();
{
//no lines visible
for(ChatLine* line : visibleLines)
line->visibilityChanged(false);
visibleLines.clear();
return;
}
// find last visible row
QList<ChatLine*>::const_iterator lowerBound;
@ -539,9 +546,6 @@ void ChatLog::checkVisibility() @@ -539,9 +546,6 @@ void ChatLog::checkVisibility()
return lhs->boundingSceneRect().bottom() < rhs;
});
if(lowerBound == lines.end())
lowerBound = lines.end();
// set visibilty
QList<ChatLine*> newVisibleLines;
for(auto itr = upperBound; itr <= lowerBound && itr != lines.cend(); ++itr)

Loading…
Cancel
Save