From bd77c88efc9327805b6f6fd83fa0492ed59d0f9a Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 17 Jan 2025 22:09:25 +0100 Subject: next commit --- client.gd | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'client.gd') diff --git a/client.gd b/client.gd index 516ba4d..73f880c 100644 --- a/client.gd +++ b/client.gd @@ -30,16 +30,21 @@ func show_message_window( if anchor == SIDE_TOP: window.global_position.y -= window.size.y - window.size.x = max(window.size.x, attached_to.size.x) elif anchor == SIDE_BOTTOM: window.global_position.y += attached_to.size.y - window.size.x = max(window.size.x, attached_to.size.x) elif anchor == SIDE_LEFT: window.global_position.x -= window.size.x - window.size.y = max(window.size.y, attached_to.size.y) elif anchor == SIDE_RIGHT: window.global_position.x += attached_to.size.x + + if anchor == SIDE_TOP or anchor == SIDE_BOTTOM: + window.size.x = max(window.size.x, attached_to.size.x) + if window.size.x > attached_to.size.x: + window.global_position.x -= (window.size.x - attached_to.size.x) * 0.5 + elif anchor == SIDE_LEFT or anchor == SIDE_RIGHT: window.size.y = max(window.size.y, attached_to.size.y) + if window.size.y > attached_to.size.y: + window.global_position.y -= (window.size.y - attached_to.size.y) * 0.5 # else add window in center else: -- cgit v1.2.3