Limit number of iterations to minimally 1
This commit is contained in:
parent
c1f171a3ae
commit
7e785422b4
|
@ -61,6 +61,7 @@ def print_set(screen, cols, rows, matrix, char):
|
||||||
screen.addstr(i, j, ' ', curses.color_pair(1))
|
screen.addstr(i, j, ' ', curses.color_pair(1))
|
||||||
else:
|
else:
|
||||||
color_index = (int(iteration) + 2) % COLOR_COUNT
|
color_index = (int(iteration) + 2) % COLOR_COUNT
|
||||||
|
color_index = 2 if color_index < 2 else color_index
|
||||||
screen.addstr(i, j, ' ', curses.color_pair(color_index))
|
screen.addstr(i, j, ' ', curses.color_pair(color_index))
|
||||||
|
|
||||||
screen.addstr(rows, 0, f'Iterations: {MAX_ITERS}, Zoom: {ZOOM_LEVEL}, Char: {char}', curses.color_pair(COLOR_COUNT))
|
screen.addstr(rows, 0, f'Iterations: {MAX_ITERS}, Zoom: {ZOOM_LEVEL}, Char: {char}', curses.color_pair(COLOR_COUNT))
|
||||||
|
@ -103,7 +104,7 @@ def handle_keyboard(char):
|
||||||
MAX_ITERS += 1
|
MAX_ITERS += 1
|
||||||
return False
|
return False
|
||||||
elif char == 45: # Iterations down
|
elif char == 45: # Iterations down
|
||||||
MAX_ITERS -= 1
|
MAX_ITERS = 1 if MAX_ITERS == 1 else MAX_ITERS - 1
|
||||||
return False
|
return False
|
||||||
elif char == 99: # Toggle colors
|
elif char == 99: # Toggle colors
|
||||||
if MONOCHROME:
|
if MONOCHROME:
|
||||||
|
|
Loading…
Reference in New Issue