diff options
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: |