From f17dee09e87e8ce455dbe01485a0cbd7df9b6035 Mon Sep 17 00:00:00 2001 From: starnakin Date: Sat, 27 May 2023 12:52:23 +0200 Subject: [PATCH] add: if pos - start != render_distance then increase stop --- utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 450643e..f98657c 100644 --- a/utils.py +++ b/utils.py @@ -8,7 +8,15 @@ def render(pos: int, min: int, max: int, render_distance: int, elements: list): i = 0; y = pos - start; if (y < min): - y = pos ; + y = pos; + if (stop - start != render_distance * 2 + 1): + if (pos - start != render_distance): + stop = stop + render_distance - start - pos + # elif (stop + render_distance > max): + # start = start - (stop + render_distance - max) + y = pos - start; + if (y < min): + y = pos; return (start, stop, y); def get_sizes(size1: int, size2: int, total_size: int, aim_ratio: float):