From 1816adc5b24f4a6577b3bfee6c32224d058a048c Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Sun, 20 Mar 2005 12:21:11 +0000 Subject: [PATCH] Fixed console cursor positioning. --- ChangeLog | 2 ++ console/CON_console.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 61a1c987..8497d3ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-03-20 Bradley Bell + * console/CON_console.c: Fixed console cursor positioning. + * main/text.c: revert to Error if text file not found. 2005-03-20 Martin Schaffner diff --git a/console/CON_console.c b/console/CON_console.c index 7960173e..d7fac73c 100644 --- a/console/CON_console.c +++ b/console/CON_console.c @@ -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); -- 2.39.2