From 84b4d185164db3858a3c6bb45064b1d119379e2f Mon Sep 17 00:00:00 2001 From: Freddy Date: Sat, 4 Jan 2020 20:35:04 +0100 Subject: [PATCH] Recalculate lines on textbox resize --- qcsrc/menu/xonotic/textbox.qc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qcsrc/menu/xonotic/textbox.qc b/qcsrc/menu/xonotic/textbox.qc index 7623bbcef..4e6817d37 100644 --- a/qcsrc/menu/xonotic/textbox.qc +++ b/qcsrc/menu/xonotic/textbox.qc @@ -48,6 +48,19 @@ void XonoticTextBox_resizeNotify(entity me, vector relOrigin, vector relSize, ve me.itemAbsSize.x = absSize.x * (1 - me.controlWidth); me.realFontSize.y = me.fontSize / me.itemAbsSize.y; me.realFontSize.x = me.fontSize / me.itemAbsSize.x; + string temp = string_null; + for (int i = 0; i < me.nItems; ++i) + { + if (!temp) + { + temp = me.getTextBoxContent(me, i); + } + else + { + temp = strcat(temp, "\n", me.getTextBoxContent(me, i)); + } + } + me.setText(me, temp); } void XonoticTextBox_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused) -- 2.39.2