summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-05-12 16:41:09 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-05-12 16:41:09 (GMT)
commit0512a7015608cb0fe384bf46174a643b4b3e520c (patch)
treeefd460ad988cb30b35fa505ec26d9474e98b827e
parent4e43c0684d713d4269fc7ed6c89286b3c2381986 (diff)
downloadmisc-0512a7015608cb0fe384bf46174a643b4b3e520c.zip
misc-0512a7015608cb0fe384bf46174a643b4b3e520c.tar.gz
misc-0512a7015608cb0fe384bf46174a643b4b3e520c.tar.bz2
meme/gui.c, README: add "sticky" contrast enhancement mode
-rw-r--r--meme/README4
-rw-r--r--meme/gui.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/meme/README b/meme/README
index c3d6531..cd1ad6a 100644
--- a/meme/README
+++ b/meme/README
@@ -77,6 +77,10 @@ that exceed the contrast range are shown in yellow.
The normal mapping is restored when releasing the C key.
+If a Shift key is pressed when releasing C, the scroll wheel function is
+returned to zooming, but the enhanced greyscale mapping stays active. To
+reset it, press and release C without holding Shift.
+
Highlight equal
---------------
diff --git a/meme/gui.c b/meme/gui.c
index 03660d3..d148e39 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -249,10 +249,11 @@ static void begin_contrast(void)
}
-static void end_contrast(void)
+static void end_contrast(bool modifier)
{
contrast_mode = 0;
- reset_z_grad();
+ if (!modifier)
+ reset_z_grad();
}
@@ -1425,7 +1426,7 @@ static bool event_loop(SDL_Surface **surf, const char *logfile,
case SDL_KEYUP:
switch (event.key.keysym.sym) {
case SDLK_c:
- end_contrast();
+ end_contrast(event.key.keysym.mod & KMOD_SHIFT);
return 0;
case SDLK_e:
end_equal();