summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/menu.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-08-04 13:59:47 -0400
committerNeil Moore <neil@s-z.org>2012-08-04 14:06:01 -0400
commitbf862027bc541e1fa69f34975c2859918c8ab84c (patch)
tree389bf7d466c21d20c870a86dc7ab8277fb327bbf /crawl-ref/source/menu.cc
parent7d82df6c3cb559c1a7423225640b46a7927db6cc (diff)
downloadcrawl-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.cc5
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);
}