diff options
author | Neil Moore <neil@s-z.org> | 2012-08-04 13:59:47 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-08-04 14:06:01 -0400 |
commit | bf862027bc541e1fa69f34975c2859918c8ab84c (patch) | |
tree | 389bf7d466c21d20c870a86dc7ab8277fb327bbf /crawl-ref/source/menu.cc | |
parent | 7d82df6c3cb559c1a7423225640b46a7927db6cc (diff) | |
download | crawl-ref-bf862027bc541e1fa69f34975c2859918c8ab84c.tar.gz crawl-ref-bf862027bc541e1fa69f34975c2859918c8ab84c.zip |
Minor fix to menu title redraw.
When the menu title changed (e.g. \ <ctrl-d>), the last column was not
replaced because of an off-by-one error. Furthermore, if the new title
was exactly as wide as the screen (e.g. \ <ctrl-d> <ctrl-d>), the next
line would be wiped.
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r-- | crawl-ref/source/menu.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index ce0a28e41c..aa21376d1e 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -1259,8 +1259,11 @@ void Menu::write_title() cprintf(" (page %d of %d)", curpage, numpages); } + // Don't clear the next line if the title was exactly as wide as the + // screen; but do clear the current line if the title was empty. const int x = wherex(), y = wherey(); - cprintf("%-*s", get_number_of_cols() - x, ""); + if (x > 1 || text.empty()) + cprintf("%-*s", get_number_of_cols() + 1 - x, ""); cgotoxy(x, y); } |