Skip to content

Commit

Permalink
Fixed crash when scrolling up really fast. (#4621)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mm2PL authored May 11, 2023
1 parent 1f0aa80 commit 1d4c6d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Bugfix: Domains starting with `http` are now parsed as links again. (#4598)
- Bugfix: Fixed click effects on buttons not being antialiased. (#4473)
- Bugfix: Fixed Ctrl+Backspace not working after Select All in chat search popup. (#4461)
- Bugfix: Fixed crash when scrolling up really fast. (#4621)
- Dev: Added the ability to control the `followRedirect` mode for requests. (#4594)

## 2.4.3
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/helper/ChannelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,8 @@ void ChannelView::wheelEvent(QWheelEvent *event)
{
float mouseMultiplier = getSettings()->mouseScrollMultiplier;

qreal desired = this->scrollBar_->getDesiredValue();
// This ensures snapshot won't be indexed out of bounds when scrolling really fast
qreal desired = std::max<qreal>(0, this->scrollBar_->getDesiredValue());
qreal delta = event->angleDelta().y() * qreal(1.5) * mouseMultiplier;

auto &snapshot = this->getMessagesSnapshot();
Expand Down

0 comments on commit 1d4c6d5

Please sign in to comment.