Skip to content

Commit

Permalink
Fix math calculation in HUD_DrawBar, rounding float too soon (fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Aug 17, 2019
1 parent fd21751 commit ddf4b42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/EntitiesMP/Common/HUD.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -519,18 +519,18 @@ static void HUD_DrawBar( FLOAT fCenterX, FLOAT fCenterY, PIX pixSizeX, PIX pixSi
// determine bar position and inner size
switch( eBarOrientation) {
case BO_UP:
pixSizeJ *= (PIX) fNormValue;
pixSizeJ = (PIX) (pixSizeJ*fNormValue);
break;
case BO_DOWN:
pixUpper = pixUpper + (PIX)ceil(pixSizeJ * (1.0f-fNormValue));
pixSizeJ *= (PIX) fNormValue;
pixSizeJ = (PIX) (pixSizeJ*fNormValue);
break;
case BO_LEFT:
pixSizeI *= (PIX) fNormValue;
pixSizeI = (PIX) (pixSizeI*fNormValue);
break;
case BO_RIGHT:
pixLeft = pixLeft + (PIX)ceil(pixSizeI * (1.0f-fNormValue));
pixSizeI *= (PIX) fNormValue;
pixSizeI = (PIX) (pixSizeI*fNormValue);
break;
}
// done
Expand Down

0 comments on commit ddf4b42

Please sign in to comment.