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/%22https:/validator.w3.org/%7B%7Bdb.prefix%7D%7D/te%22st.html?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