mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 23:16:17 +00:00
Fix bug with scrollbar overlaying text in GUI textbox (fixes bug #21364)
This commit is contained in:
parent
d1a9f1f259
commit
1f94869fd7
@ -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:
|
||||
|
@ -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_);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user