Fixed console cursor positioning.

This commit is contained in:
Bradley Bell 2005-03-20 12:21:11 +00:00
parent 9ef479b28b
commit 1816adc5b2
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,7 @@
2005-03-20 Bradley Bell <btb@icculus.org>
* console/CON_console.c: Fixed console cursor positioning.
* main/text.c: revert to Error if text file not found.
2005-03-20 Martin Schaffner <schaffnerb@gmx.ch>

View file

@ -681,7 +681,11 @@ void DrawCommandLine() {
}
if(Blink) {
x = CON_CHAR_BORDER + Topmost->ConsoleSurface->cv_font->ft_w * (Topmost->CursorPos - Topmost->Offset + strlen(Topmost->Prompt));
int prompt_width, command_width, h, w;
gr_get_string_size(Topmost->Prompt, &prompt_width, &h, &w);
gr_get_string_size(Topmost->LCommand + Topmost->Offset, &cmd_width, &h, &w);
x = CON_CHAR_BORDER + prompt_width + cmd_width;
orig_color = FG_COLOR;
if(Topmost->InsMode)
gr_string(x, Topmost->ConsoleSurface->cv_h - Topmost->ConsoleSurface->cv_font->ft_h, CON_INS_CURSOR);