engine: fix CenterPrint Wrong Y Position.

This commit is contained in:
xiaodo 2024-10-05 03:23:02 +08:00 committed by Alibek Omarov
parent d1e118f07c
commit 8c291fdfe3

View file

@ -283,19 +283,19 @@ static int CL_AdjustYPos( float y, int height )
if( y == -1 ) // centered? if( y == -1 ) // centered?
{ {
yPos = ( refState.height - height ) * 0.5f; yPos = (clgame.scrInfo.iHeight - height ) * 0.5f;
} }
else else
{ {
// Alight bottom? // Alight bottom?
if( y < 0 ) if( y < 0 )
yPos = (1.0f + y) * refState.height - height; // Alight bottom yPos = (1.0f + y) * clgame.scrInfo.iHeight - height; // Alight bottom
else // align top else // align top
yPos = y * refState.height; yPos = y * clgame.scrInfo.iHeight;
} }
if( yPos + height > refState.height ) if( yPos + height > clgame.scrInfo.iHeight)
yPos = refState.height - height; yPos = clgame.scrInfo.iHeight - height;
else if( yPos < 0 ) else if( yPos < 0 )
yPos = 0; yPos = 0;