From a5b5331fa454c9c2c94e272eddd7e6f23d63c6f3 Mon Sep 17 00:00:00 2001 From: Vantha Date: Fri, 5 Sep 2025 23:02:56 +0200 Subject: [PATCH] Fix chat line button sizing The issue was that the rright value was 100%. That's why the buttons would always extend across the full width of the screen. Replacing the value right in the XML would result in an invalid size, so we can remove it from there and create a full, separate size in the code each time (Object.assign just edits it), since the top and bottom values specified in the XML were overwritten anyway. And since the left margin of 3 is fixed, we better move it to the parent object to avoid a constant like that in the code. Fixes #8322 --- binaries/data/mods/public/gui/session/chat/ChatOverlay.js | 6 +++--- binaries/data/mods/public/gui/session/session.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/binaries/data/mods/public/gui/session/chat/ChatOverlay.js b/binaries/data/mods/public/gui/session/chat/ChatOverlay.js index 06fc509f72..c5d2dc6814 100644 --- a/binaries/data/mods/public/gui/session/chat/ChatOverlay.js +++ b/binaries/data/mods/public/gui/session/chat/ChatOverlay.js @@ -39,11 +39,11 @@ class ChatOverlay this.chatLines[i].caption = chatMessage.text; const newSize = this.chatLines[i].getPreferredTextSize(); - Object.assign(this.chatLines[i].size, { + this.chatLines[i].size = { "top": i * newSize.height, "bottom": (i + 1) * newSize.height, - "right": this.chatLines[i].size.left + newSize.width - }); + "right": newSize.width + }; if (chatMessage.callback) this.chatLines[i].onPress = chatMessage.callback; diff --git a/binaries/data/mods/public/gui/session/session.xml b/binaries/data/mods/public/gui/session/session.xml index 4459cf0bee..179b663213 100644 --- a/binaries/data/mods/public/gui/session/session.xml +++ b/binaries/data/mods/public/gui/session/session.xml @@ -43,10 +43,10 @@ - + -