Add keymap to reset zoom

This commit is contained in:
Pavle Portic 2019-02-03 03:58:13 +01:00
parent 0e2cc929a3
commit 24afbfc854
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
2 changed files with 7 additions and 3 deletions

View File

@ -2,6 +2,7 @@
A simple python script that draws an interactive mandelbrot set in the terminal A simple python script that draws an interactive mandelbrot set in the terminal
## Keybindings ## Keybindings
- Arrows - Move around - Arrow keys - Move around
- `(`/`)` - Zooming - `(`/`)` - Zoom in and out
- `+`/`-` - Change the number of iterations to run - `=` - Reset zoom
- `+`/`-` - Change the number of iterations to run per pixel

View File

@ -91,6 +91,9 @@ def handle_keyboard(char):
elif char == 41: # Zoom in elif char == 41: # Zoom in
ZOOM_LEVEL += 1 ZOOM_LEVEL += 1
return False return False
elif char == 61: # Zoom reset
ZOOM_LEVEL = 0
return False
elif char == 43: # Iterations up elif char == 43: # Iterations up
MAX_ITERS += 1 MAX_ITERS += 1
return False return False