From 24afbfc85424576c3d673ad80f30693aa421dbd3 Mon Sep 17 00:00:00 2001 From: Pavle Portic Date: Sun, 3 Feb 2019 03:58:13 +0100 Subject: [PATCH] Add keymap to reset zoom --- README.md | 7 ++++--- mandelbrot.py | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3997a50..0f7236a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ A simple python script that draws an interactive mandelbrot set in the terminal ## Keybindings -- Arrows - Move around -- `(`/`)` - Zooming -- `+`/`-` - Change the number of iterations to run +- Arrow keys - Move around +- `(`/`)` - Zoom in and out +- `=` - Reset zoom +- `+`/`-` - Change the number of iterations to run per pixel diff --git a/mandelbrot.py b/mandelbrot.py index a066038..97a9b85 100644 --- a/mandelbrot.py +++ b/mandelbrot.py @@ -91,6 +91,9 @@ def handle_keyboard(char): elif char == 41: # Zoom in ZOOM_LEVEL += 1 return False + elif char == 61: # Zoom reset + ZOOM_LEVEL = 0 + return False elif char == 43: # Iterations up MAX_ITERS += 1 return False