mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix no visible line case
This commit is contained in:
parent
2938702c1e
commit
a0a56e32a0
|
@ -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()
|
|||
});
|
||||
|
||||
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()
|
|||
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…
Reference in New Issue
Block a user