From: Christian Heller Date: Sat, 5 Mar 2016 11:37:18 +0000 (+0100) Subject: Client: Fix bug adding win width padding to log lines when not needed. X-Git-Tag: tce~91 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/static/%7B%7Bprefix%7D%7D/tasks?a=commitdiff_plain;h=8164be4d1b6e6a9d36e8c7f0f58d4f799f990a25;p=plomrogue Client: Fix bug adding win width padding to log lines when not needed. --- diff --git a/client/windows.py b/client/windows.py index 9eddc1c..3966d0c 100644 --- a/client/windows.py +++ b/client/windows.py @@ -108,7 +108,8 @@ def win_log(self): number_of_lines = 0 for line in world_data["log"]: number_of_lines += math.ceil(len(line) / win_size[1]) - padding_size = win_size[1] - (len(line) % win_size[1]) + mod = len(line) % win_size[1] + padding_size = 0 if mod == 0 else win_size[1] - mod winmap += line + (padding_size * " ") if number_of_lines < win_size[0]: winmap = (" " * win_size[1] * (win_size[0] - number_of_lines)) + winmap