Fix bug with scrollbar overlaying text in GUI textbox (fixes bug #21364)

This commit is contained in:
David Mikos 2013-12-26 12:14:46 +10:30
parent d1a9f1f259
commit 1f94869fd7
2 changed files with 12 additions and 7 deletions

View File

@ -120,6 +120,7 @@ Version 1.11.7+dev:
wesnothd executable) interpreting special markup at the beginning of file
names such as "#foo.map".
* Fixed bug with modifications dependency check dialogs (bug #21365)
* Fixed bug with scrollbar overlaying mp description text (bug #21364)
Version 1.11.7:
* Add-ons client:

View File

@ -66,13 +66,17 @@ const std::string textbox::text() const
// set_text does not respect max_size_
void textbox::set_text(const std::string& text, const SDL_Color& color)
{
text_ = utils::string_to_wstring(text);
cursor_ = text_.size();
text_pos_ = 0;
selstart_ = -1;
selend_ = -1;
set_dirty(true);
update_text_cache(true, color);
// Loop twice so that if a scrollbar needs to be shown/hidden the
// horizontal text fit is recalculated.
for (size_t i=0; i<2; ++i) {
text_ = utils::string_to_wstring(text);
cursor_ = text_.size();
text_pos_ = 0;
selstart_ = -1;
selend_ = -1;
set_dirty(true);
update_text_cache(true, color);
}
handle_text_changed(text_);
}