浏览代码

[F] Fix random count being negative when screen is too small

Hykilpikonna 2 年之前
父节点
当前提交
ed3bb65824
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      hyfetch/main.py

+ 1 - 1
hyfetch/main.py

@@ -291,7 +291,7 @@ def create_config() -> Config:
         while len(pis) < len(slots):
             pis += pis
         perm = {p[:len(slots)] for p in permutations(pis)}
-        random_count = ascii_per_row * ascii_rows - len(arrangements)
+        random_count = max(0, ascii_per_row * ascii_rows - len(arrangements))
         if random_count > len(perm):
             choices = perm
         else: