Skip to content

Commit

Permalink
DrawAreaBase: Fix crash for mouse wheel scrolling to upper (JDimprove…
Browse files Browse the repository at this point in the history
…d#1391)

スレビューでマウスホイールを使ってスクロールしたときに異常終了すること
があったため修正します。 修正前は値の範囲を調べる変数を間違えていました。

修正にあたり不具合報告をしていただきありがとうございました。
https://next2ch.net/linux/1654053581/195
  • Loading branch information
ma8ma committed May 5, 2024
1 parent 368d7c5 commit 60a7dad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/article/drawareabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ void DrawAreaBase::exec_scroll()
break;
}

const int y_new = static_cast<int>(std::clamp<double>( adjust->get_upper() - adjust->get_page_size(), 0, y ));
const int y_new = static_cast<int>(std::clamp<double>( y, 0, adjust->get_upper() - adjust->get_page_size() ));
if( current_y != y_new ){

m_cancel_change_adjust = true;
Expand Down

0 comments on commit 60a7dad

Please sign in to comment.