1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 21:09:41 +00:00

Merge branch 'toscrollornottoscroll' into 'master'

Don't create a scrollbar that cannot be scrolled

Closes #8364

See merge request OpenMW/openmw!4552
This commit is contained in:
Alexei Kotov 2025-02-24 21:35:19 +00:00
commit 73bb281f34
2 changed files with 3 additions and 1 deletions

View file

@ -227,6 +227,7 @@
Bug #8252: Plugin dependencies are not required to be loaded Bug #8252: Plugin dependencies are not required to be loaded
Bug #8295: Post-processing chain is case-sensitive Bug #8295: Post-processing chain is case-sensitive
Bug #8299: Crash while smoothing landscape Bug #8299: Crash while smoothing landscape
Bug #8364: Crash when clicking scrollbar without handle (divide by zero)
Feature #1415: Infinite fall failsafe Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

View file

@ -666,7 +666,8 @@ namespace MWGui
else if (scrollbar) else if (scrollbar)
{ {
mHistory->setSize(MyGUI::IntSize(mHistory->getWidth(), book->getSize().second)); mHistory->setSize(MyGUI::IntSize(mHistory->getWidth(), book->getSize().second));
size_t range = book->getSize().second - viewHeight; // Scroll range should be >= 2 to enable scrolling and prevent a crash
size_t range = std::max(book->getSize().second - viewHeight, size_t(2));
mScrollBar->setScrollRange(range); mScrollBar->setScrollRange(range);
mScrollBar->setScrollPosition(range - 1); mScrollBar->setScrollPosition(range - 1);
mScrollBar->setTrackSize( mScrollBar->setTrackSize(