1
0
Fork 0

Fix #13121: Crash when clicking on scrollbar if contents don't need scrolling.

pull/13122/head
Peter Nelson 2024-11-24 23:00:54 +00:00
parent 0446123194
commit c27b3bca74
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 1 additions and 0 deletions

View File

@ -2309,6 +2309,7 @@ static void HandleScrollbarScrolling(Window *w)
/* Find the item we want to move to. SetPosition will make sure it's inside bounds. */
int range = sb->GetCount() - sb->GetCapacity();
if (range <= 0) return;
int pos = RoundDivSU((i + _scrollbar_start_pos) * range, _scrollbar_size);
if (rtl) pos = range - pos;