Add keymap to reset zoom
This commit is contained in:
parent
0e2cc929a3
commit
24afbfc854
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue