Limit number of iterations to minimally 1

This commit is contained in:
Pavle Portic 2019-02-03 14:25:18 +01:00
parent c1f171a3ae
commit 7e785422b4
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
1 changed files with 2 additions and 1 deletions

View File

@ -61,6 +61,7 @@ def print_set(screen, cols, rows, matrix, char):
screen.addstr(i, j, ' ', curses.color_pair(1))
else:
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(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
return False
elif char == 45: # Iterations down
MAX_ITERS -= 1
MAX_ITERS = 1 if MAX_ITERS == 1 else MAX_ITERS - 1
return False
elif char == 99: # Toggle colors
if MONOCHROME: