mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
LoadingScreen: ensure values are within progress range
This commit is contained in:
parent
625644e917
commit
67883feaae
1 changed files with 2 additions and 0 deletions
|
@ -209,6 +209,7 @@ namespace MWGui
|
|||
// skip expensive update if there isn't enough visible progress
|
||||
if (value - mProgress < mProgressBar->getScrollRange()/200.f)
|
||||
return;
|
||||
value = std::min(value, mProgressBar->getScrollRange()-1);
|
||||
mProgress = value;
|
||||
mProgressBar->setScrollPosition(0);
|
||||
mProgressBar->setTrackSize(static_cast<int>(value / (float)(mProgressBar->getScrollRange()) * mProgressBar->getLineSize()));
|
||||
|
@ -219,6 +220,7 @@ namespace MWGui
|
|||
{
|
||||
mProgressBar->setScrollPosition(0);
|
||||
size_t value = mProgress + increase;
|
||||
value = std::min(value, mProgressBar->getScrollRange()-1);
|
||||
mProgress = value;
|
||||
mProgressBar->setTrackSize(static_cast<int>(value / (float)(mProgressBar->getScrollRange()) * mProgressBar->getLineSize()));
|
||||
draw();
|
||||
|
|
Loading…
Reference in a new issue