diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-01-17 22:09:25 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-01-17 22:09:25 +0100 |
commit | bd77c88efc9327805b6f6fd83fa0492ed59d0f9a (patch) | |
tree | 99ed473ec1c137b774bd5e2a0e2bca9e56daf691 /client.gd | |
parent | e8f03c4d6a94aa16b3587bdce525cf0cf7c6c6c3 (diff) |
Diffstat (limited to 'client.gd')
-rw-r--r-- | client.gd | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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: |