summaryrefslogtreecommitdiff
path: root/network_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-07 08:57:03 +0000
committertron <tron@openttd.org>2006-04-07 08:57:03 +0000
commit7a7e7c82cf54f86f8144b99949d564d172f1a8a8 (patch)
tree8d113f13e84e0399a884f5905236ab2989aa839e /network_gui.c
parentfd097af20e62ff61f5edf9c3c45a53c7ff7cfcbf (diff)
downloadopenttd-7a7e7c82cf54f86f8144b99949d564d172f1a8a8.tar.xz
(svn r4312) Calculate the maximum pixel width of the entered text in the chat box from the "text box"-widget instead of hardcoding an arbitrary - and wrong - number
Diffstat (limited to 'network_gui.c')
-rw-r--r--network_gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/network_gui.c b/network_gui.c
index c29151d80..4d089c01d 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -1545,7 +1545,7 @@ static const WindowDesc _chat_window_desc = {
ChatWindowWndProc
};
-void ShowChatWindow(int maxlen, int maxwidth, WindowClass window_class, WindowNumber window_number)
+void ShowChatWindow(int maxlen, WindowClass window_class, WindowNumber window_number)
{
Window *w;
@@ -1561,7 +1561,7 @@ void ShowChatWindow(int maxlen, int maxwidth, WindowClass window_class, WindowNu
WP(w,querystr_d).wnd_num = window_number;
WP(w,querystr_d).text.caret = false;
WP(w,querystr_d).text.maxlength = maxlen;
- WP(w,querystr_d).text.maxwidth = maxwidth;
+ WP(w,querystr_d).text.maxwidth = w->widget[1].right - w->widget[1].left - 2; // widget[1] is the "text box"
WP(w,querystr_d).text.buf = _edit_str_buf;
UpdateTextBufferSize(&WP(w, querystr_d).text);
}