home · contact · privacy
Client: Fix bug adding win width padding to log lines when not needed.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 5 Mar 2016 11:37:18 +0000 (12:37 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 5 Mar 2016 11:37:18 +0000 (12:37 +0100)
client/windows.py

index 9eddc1cb33beb722e269c30edcca0b5cdcd6b81f..3966d0c4d20312b9cc99b8f746ac8a67928f59d8 100644 (file)
@@ -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