mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
- fixed: DrawBar never checked maxval for dividing by 0.
This commit is contained in:
parent
1f69a000df
commit
316af5a400
1 changed files with 1 additions and 1 deletions
|
@ -978,7 +978,7 @@ class BaseStatusBar native ui
|
||||||
Vector2 texsize = TexMan.GetScaledSize(ontex);
|
Vector2 texsize = TexMan.GetScaledSize(ontex);
|
||||||
[position, flags] = AdjustPosition(position, flags, texsize.X, texsize.Y);
|
[position, flags] = AdjustPosition(position, flags, texsize.X, texsize.Y);
|
||||||
|
|
||||||
double value = clamp(curval / maxval, 0, 1);
|
double value = (maxval != 0) ? clamp(curval / maxval, 0, 1) : 0;
|
||||||
if(border != 0) value = 1. - value; //invert since the new drawing method requires drawing the bg on the fg.
|
if(border != 0) value = 1. - value; //invert since the new drawing method requires drawing the bg on the fg.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue