diff options
author | terkhen <terkhen@openttd.org> | 2011-04-17 18:45:36 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2011-04-17 18:45:36 +0000 |
commit | 8bc9925ade79d963ee363cbe7aabbfbe2266113c (patch) | |
tree | 4b093fda7706e4230675d15be56458b4112f8f34 /src/misc_gui.cpp | |
parent | 5bb7a48cd23a61ed523d09a5884848aa94e47da6 (diff) | |
download | openttd-8bc9925ade79d963ee363cbe7aabbfbe2266113c.tar.xz |
(svn r22346) -Cleanup: Textbuf::max_pixels is not required anymore.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index a3954a913..e0e29c050 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1042,7 +1042,7 @@ bool InsertTextBufferChar(Textbuf *tb, WChar key) { const byte charwidth = GetCharacterWidth(FS_NORMAL, key); uint16 len = (uint16)Utf8CharLen(key); - if (tb->bytes + len <= tb->max_bytes && tb->chars + 1 <= tb->max_chars && (tb->max_pixels == 0 || tb->pixels + charwidth <= tb->max_pixels)) { + if (tb->bytes + len <= tb->max_bytes && tb->chars + 1 <= tb->max_chars) { memmove(tb->buf + tb->caretpos + len, tb->buf + tb->caretpos, tb->bytes - tb->caretpos); Utf8Encode(tb->buf + tb->caretpos, key); tb->chars++; @@ -1079,7 +1079,6 @@ bool InsertTextBufferClipboard(Textbuf *tb) if (tb->chars + chars + 1 > tb->max_chars) break; byte char_pixels = GetCharacterWidth(FS_NORMAL, c); - if (tb->max_pixels != 0 && pixels + tb->pixels + char_pixels > tb->max_pixels) break; pixels += char_pixels; bytes += len; @@ -1181,7 +1180,6 @@ void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 max_bytes, uint16 max_c tb->buf = buf; tb->max_bytes = max_bytes; tb->max_chars = max_chars; - tb->max_pixels = 0; tb->caret = true; UpdateTextBufferSize(tb); } |