From f473265fb09321aaa08ffb5c10263d34e1e1c557 Mon Sep 17 00:00:00 2001 From: KK Date: Sat, 24 Jul 2021 22:43:32 -0700 Subject: [PATCH] This little hack, tries to fix the bad Behavior hiding the chat behind the chat window. --- voxygen/src/hud/chat.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index f395f4724c..c05177e1ca 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -214,6 +214,14 @@ impl<'a> Widget for Chat<'a> { let chat_tabs = &chat_settings.chat_tabs; let current_chat_tab = chat_settings.chat_tab_index.and_then(|i| chat_tabs.get(i)); + + // Empty old messages + state.update(|s| { + while s.messages.len() > MAX_MESSAGES { + s.messages.pop_front(); + } + }); + // Maintain scrolling // if !self.new_messages.is_empty() { //new messages - update chat w/ them & scroll down if at bottom of chat @@ -236,13 +244,6 @@ impl<'a> Widget for Chat<'a> { state.update(|s| s.scroll_next = true); //make scroll happen only once any filters to the messages have already been applied } - // Empty old messages - state.update(|s| { - while s.messages.len() > MAX_MESSAGES { - s.messages.pop_front(); - } - }); - if let Some(comps) = &self.force_completions { state.update(|s| s.completions = comps.clone()); }