WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 91621cb

Browse files
committed
Fix console border drawing with negative con_margin
It didn't draw the side borders.
1 parent e590ca9 commit 91621cb

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/engine/client/cl_console.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,18 +592,19 @@ void Con_DrawBackground()
592592
//top border
593593
SCR_FillRect( consoleState.margin.sides - consoleState.border.sides,
594594
consoleState.margin.top - consoleState.border.top,
595-
consoleWidth + consoleState.border.sides, consoleState.border.top, borderColor );
595+
consoleWidth + 2 * consoleState.border.sides, consoleState.border.top, borderColor );
596+
596597
//left border
597598
SCR_FillRect( consoleState.margin.sides - consoleState.border.sides, consoleState.margin.top,
598-
consoleState.border.sides, consoleState.height + consoleState.border.bottom, borderColor );
599+
consoleState.border.sides, consoleState.height, borderColor );
599600

600601
//right border
601-
SCR_FillRect( cls.windowConfig.vidWidth - consoleState.margin.sides, consoleState.margin.top - consoleState.border.top,
602-
consoleState.border.sides, consoleState.border.top + consoleState.height, borderColor );
602+
SCR_FillRect( cls.windowConfig.vidWidth - consoleState.margin.sides, consoleState.margin.top,
603+
consoleState.border.sides, consoleState.height, borderColor );
603604

604605
//bottom border
605-
SCR_FillRect( consoleState.margin.sides, consoleState.height + consoleState.margin.top + consoleState.border.top - consoleState.border.bottom,
606-
consoleWidth + consoleState.border.sides, consoleState.border.bottom, borderColor );
606+
SCR_FillRect( consoleState.margin.sides - consoleState.border.sides, consoleState.height + consoleState.margin.top,
607+
consoleWidth + 2 * consoleState.border.sides, consoleState.border.bottom, borderColor );
607608
}
608609
else
609610
{
@@ -963,7 +964,7 @@ void Con_UpdateConsoleState()
963964
} else {
964965
horizontalMargin = - con_margin.Get();
965966
verticalMargin = 0;
966-
consoleState.border.sides = 0;
967+
consoleState.border.sides = con_margin.Get() != 0 ? consoleState.border.bottom : 0;
967968
consoleState.border.top = 0;
968969
}
969970

0 commit comments

Comments
 (0)