- fixed: DrawBar never checked maxval for dividing by 0.

This commit is contained in:
Major Cooke 2017-04-18 23:12:21 -05:00 committed by Christoph Oelckers
parent 1f69a000df
commit 316af5a400

View file

@ -978,7 +978,7 @@ class BaseStatusBar native ui
Vector2 texsize = TexMan.GetScaledSize(ontex);
[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.