diff options
author | rubidium <rubidium@openttd.org> | 2006-12-31 14:34:26 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-12-31 14:34:26 +0000 |
commit | 4c855b46134007428c372898d72aec57c3154485 (patch) | |
tree | d64f3c5d495a40e9be2621c9b35a98c67446ee08 /misc_gui.c | |
parent | cafdfa1ff284504553b0b584202ca15f7a141c19 (diff) | |
download | openttd-4c855b46134007428c372898d72aec57c3154485.tar.xz |
(svn r7700) -Fix (r7182): the caret 'randomly' jumped back and forth when getting a new randomised seed in the Generation World GUI.
Diffstat (limited to 'misc_gui.c')
-rw-r--r-- | misc_gui.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/misc_gui.c b/misc_gui.c index 1bca0f997..94917cfdf 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -942,12 +942,13 @@ void UpdateTextBufferSize(Textbuf *tb) WChar c = Utf8Consume(&buf); tb->width = 0; + tb->length = 0; for (; c != '\0' && tb->length < (tb->maxlength - 1); c = Utf8Consume(&buf)) { tb->width += GetCharacterWidth(FS_NORMAL, c); + tb->length += Utf8CharLen(c); } - tb->length = buf - tb->buf - 1; tb->caretpos = tb->length; tb->caretxoffs = tb->width; } |