summaryrefslogtreecommitdiff
path: root/meme/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2014-09-13 13:31:24 (GMT)
committerWerner Almesberger <werner@almesberger.net>2014-09-13 13:31:24 (GMT)
commit98275d5c8507482a6c49b05afd0b3076df6fbf91 (patch)
treef61a98064d6e0745dcf1ee7520ba2ea8d1fb3755 /meme/gui.c
parent2fca07a9e40e29751a7714d7200f49048f73385b (diff)
downloadmisc-98275d5c8507482a6c49b05afd0b3076df6fbf91.zip
misc-98275d5c8507482a6c49b05afd0b3076df6fbf91.tar.gz
misc-98275d5c8507482a6c49b05afd0b3076df6fbf91.tar.bz2
meme/gui.c: toggle profiles with P
Diffstat (limited to 'meme/gui.c')
-rw-r--r--meme/gui.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/meme/gui.c b/meme/gui.c
index 93a051e..1339e7c 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -48,6 +48,7 @@ static int x_orig, y_orig;
static int x_min, x_max, y_min, y_max, z_min, z_max;
static int zoom;
static bool show_grid = 0;
+static bool show_profiles = 0;
static const struct vertex *cursor;
@@ -556,8 +557,10 @@ static void motion_event(SDL_Surface *s, SDL_MouseMotionEvent *motion)
hide_cursor(s);
cursor = find_nearest(x, y);
show_cursor(s, cursor);
- show_xz_profile(s);
- show_yz_profile(s);
+ if (show_profiles) {
+ show_xz_profile(s);
+ show_yz_profile(s);
+ }
apply_changes(s);
}
@@ -786,6 +789,10 @@ static bool event_loop(SDL_Surface *s)
show_grid = !show_grid;
redraw = 1;
break;
+ case SDLK_p:
+ show_profiles = !show_profiles;
+ redraw = 1;
+ break;
case SDLK_q:
return 1;
default:
@@ -834,6 +841,10 @@ fprintf(stderr, "%.3f s @ zoom %d\n", time_ms(&t)/1000.0, zoom);
show_markers(surf);
if (cursor) {
+ if (show_profiles) {
+ show_xz_profile(surf);
+ show_yz_profile(surf);
+ }
show_cursor(surf, cursor);
// apply_changes(surf);
}