mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
BUGFIX 522 - Coded some popup box position adjustments so that popup boxes can't be drawn off the screen.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4498 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1307,6 +1307,18 @@ BOOLEAN DrawBox(UINT32 uiCounter)
|
||||
usWidth=((UINT16)(PopUpBoxList[uiCounter]->Dimensions.iRight-PopUpBoxList[uiCounter]->Dimensions.iLeft));
|
||||
usHeight=((UINT16)(PopUpBoxList[uiCounter]->Dimensions.iBottom-PopUpBoxList[uiCounter]->Dimensions.iTop));
|
||||
|
||||
//CHRISL: Adjust position for screen limits
|
||||
if((usTopX + usWidth) > SCREEN_WIDTH && usTopX > ((usTopX + usWidth) - SCREEN_WIDTH))
|
||||
{
|
||||
usTopX -= ((usTopX + usWidth) - SCREEN_WIDTH);
|
||||
PopUpBoxList[uiCounter]->Position.iX -= (PopUpBoxList[uiCounter]->Position.iX - usTopX);
|
||||
}
|
||||
if((usTopY + usHeight) > SCREEN_HEIGHT && usTopY > ((usTopY + usHeight) - SCREEN_HEIGHT))
|
||||
{
|
||||
usTopY -= ((usTopY + usHeight) - SCREEN_HEIGHT);
|
||||
PopUpBoxList[uiCounter]->Position.iY -= (PopUpBoxList[uiCounter]->Position.iY - usTopY);
|
||||
}
|
||||
|
||||
// check if we have a min width, if so then update box for such
|
||||
if( ( PopUpBoxList[uiCounter]->uiBoxMinWidth ) && ( usWidth < PopUpBoxList[uiCounter]->uiBoxMinWidth ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user