summaryrefslogtreecommitdiff
path: root/meme
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-02-14 18:51:10 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-02-14 18:51:33 (GMT)
commitb3676ddbe975978473f4b8eeae03de04ad5fae5e (patch)
treef40da1c26627da674bf6fba65e9245c630314ee8 /meme
parentdd7e8426d3389d09592f198344d4818b99ac5b5b (diff)
downloadmisc-b3676ddbe975978473f4b8eeae03de04ad5fae5e.zip
misc-b3676ddbe975978473f4b8eeae03de04ad5fae5e.tar.gz
misc-b3676ddbe975978473f4b8eeae03de04ad5fae5e.tar.bz2
meme/gui.c (marker_line): also correct "ok" logic, inherited from "lineto"
Diffstat (limited to 'meme')
-rw-r--r--meme/gui.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/meme/gui.c b/meme/gui.c
index 7fa07ac..4ea6625 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -955,9 +955,14 @@ static void draw_overlay(SDL_Surface *s, const struct overlay *over)
static void marker_line(void *user, int xa, int ya, int xb, int yb)
{
SDL_Surface *s = user;
- Sint16 ax = 0, ay = 0, bx = 0, by = 0;
+ Sint16 ax, ay, bx, by;
+ int ok_a, ok_b;
- if (coord(xa, ya, &ax, &ay) && coord(xb, yb, &bx, &by) <= 0)
+ ok_a = coord(xa, ya, &ax, &ay);
+ ok_b = coord(xb, yb, &bx, &by);
+ if (ok_a < 0 || ok_b < 0)
+ return;
+ if (!ok_a && !ok_b)
return;
aalineColor(s, ax, ay, bx, by, MARKER_LINE_RGBA);
}