diff --git a/messages/limitedqueue.h b/messages/limitedqueue.h index ba218a6ba..9bb3d53fb 100644 --- a/messages/limitedqueue.h +++ b/messages/limitedqueue.h @@ -4,6 +4,7 @@ #include "messages/limitedqueuesnapshot.h" #include + #include #include #include @@ -102,7 +103,8 @@ private: int limit; int buffer; }; -} -} + +} // namespace messages +} // namespace chatterino #endif // LIMITEDQUEUE_H diff --git a/widgets/chatwidgetview.cpp b/widgets/chatwidgetview.cpp index 0f2407aa8..b5b9045f9 100644 --- a/widgets/chatwidgetview.cpp +++ b/widgets/chatwidgetview.cpp @@ -49,6 +49,17 @@ ChatWidgetView::layoutMessages() int start = this->scrollbar.getCurrentValue(); + if (messages.getLength() <= start) { + // The scrollbar wants to show more values than we can offer + + // just return for now + return false; + + + // Lower start value to the last message + // start = messages.getLength() - 1; + } + int y = -(messages[start].get()->getHeight() * (fmod(this->scrollbar.getCurrentValue(), 1)));