mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-12-25 15:14:51 +01:00
Fix math calculation in HUD_DrawBar, rounding float too soon (fix issue #7)
This commit is contained in:
parent
fd2175173a
commit
ddf4b42b4c
8
Sources/EntitiesMP/Common/HUD.cpp
Normal file → Executable file
8
Sources/EntitiesMP/Common/HUD.cpp
Normal file → Executable file
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user