summaryrefslogtreecommitdiff
path: root/client.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-01-17 22:09:25 +0100
committerDaniel Weipert <git@mail.dweipert.de>2025-01-17 22:09:25 +0100
commitbd77c88efc9327805b6f6fd83fa0492ed59d0f9a (patch)
tree99ed473ec1c137b774bd5e2a0e2bca9e56daf691 /client.gd
parente8f03c4d6a94aa16b3587bdce525cf0cf7c6c6c3 (diff)
next commitHEADmain
Diffstat (limited to 'client.gd')
-rw-r--r--client.gd11
1 files changed, 8 insertions, 3 deletions
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: