Fix CenterPrint Wrong X Position
This commit is contained in:
parent
6c531c14e6
commit
d1e118f07c
1 changed files with 5 additions and 5 deletions
|
@ -252,18 +252,18 @@ static int CL_AdjustXPos( float x, int width, int totalWidth )
|
||||||
|
|
||||||
if( x == -1 )
|
if( x == -1 )
|
||||||
{
|
{
|
||||||
xPos = ( refState.width - width ) * 0.5f;
|
xPos = ( clgame.scrInfo.iWidth - width ) * 0.5f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( x < 0 )
|
if ( x < 0 )
|
||||||
xPos = (1.0f + x) * refState.width - totalWidth; // Alight right
|
xPos = (1.0f + x) * clgame.scrInfo.iWidth - totalWidth; // Alight right
|
||||||
else // align left
|
else // align left
|
||||||
xPos = x * refState.width;
|
xPos = x * clgame.scrInfo.iWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xPos + width > refState.width )
|
if( xPos + width > clgame.scrInfo.iWidth)
|
||||||
xPos = refState.width - width;
|
xPos = clgame.scrInfo.iWidth - width;
|
||||||
else if( xPos < 0 )
|
else if( xPos < 0 )
|
||||||
xPos = 0;
|
xPos = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue