Slight cosmetic improvement to the window alignment code (factoring out a / 2).

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6049 4a71c877-e1ca-e34f-864e-861f7616d084
master
Freddie Witherden 2008-09-18 22:56:36 +00:00
parent ba9c453857
commit 784b40d2a0
1 changed files with 4 additions and 4 deletions

View File

@ -284,7 +284,7 @@ void windowRepositionFromScreen(window *self, hAlign hAlign, int xOffset,
x = 0;
break;
case CENTRE:
x = screenWidth / 2 - ourSize.x / 2;
x = (screenWidth - ourSize.x) / 2;
break;
case RIGHT:
x = screenWidth;
@ -300,7 +300,7 @@ void windowRepositionFromScreen(window *self, hAlign hAlign, int xOffset,
y = 0;
break;
case MIDDLE:
y = screenHeight / 2 - ourSize.y / 2;
y = (screenHeight - ourSize.y) / 2;
break;
case BOTTOM:
x = screenHeight;
@ -336,7 +336,7 @@ void windowRepositionFromAnchor(window *self, const window *anchor,
xOffset = -xOffset;
break;
case CENTRE:
x = anchorPos.x + (anchorSize.x / 2 - ourSize.x / 2);
x = anchorPos.x + (anchorSize.x - ourSize.x) / 2;
break;
case RIGHT:
x = anchorPos.x + anchorSize.x;
@ -349,7 +349,7 @@ void windowRepositionFromAnchor(window *self, const window *anchor,
y = anchorPos.y;
break;
case MIDDLE:
y = anchorPos.y + (anchorSize.x / 2 - ourSize.y / 2);
y = anchorPos.y + (anchorSize.x - ourSize.y) / 2;
break;
case BOTTOM:
y = anchorPos.y + anchorSize.y;