summaryrefslogtreecommitdiff
path: root/meme/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-02-14 18:59:30 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-02-14 18:59:30 (GMT)
commitbb83e424f5a8207676c2eb65743236a3fb9e74b2 (patch)
tree7c1ed799a2a017f400c9f77fb585080671334878 /meme/gui.c
parentb3676ddbe975978473f4b8eeae03de04ad5fae5e (diff)
downloadmisc-bb83e424f5a8207676c2eb65743236a3fb9e74b2.zip
misc-bb83e424f5a8207676c2eb65743236a3fb9e74b2.tar.gz
misc-bb83e424f5a8207676c2eb65743236a3fb9e74b2.tar.bz2
meme/: add little "T" marks at the ends of measurements
Diffstat (limited to 'meme/gui.c')
-rw-r--r--meme/gui.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/meme/gui.c b/meme/gui.c
index 4ea6625..1028417 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -947,12 +947,15 @@ static void draw_overlay(SDL_Surface *s, const struct overlay *over)
/* ----- Markers ----------------------------------------------------------- */
+#define TEE_MARK 3 /* half the mark length */
+
#define TEXT_OFFSET_X -4
#define TEXT_OFFSET_Y -5
#define TEXT_DIST 10
-static void marker_line(void *user, int xa, int ya, int xb, int yb)
+static void marker_line(void *user, int xa, int ya, int xb, int yb,
+ float nx, float ny)
{
SDL_Surface *s = user;
Sint16 ax, ay, bx, by;
@@ -964,6 +967,10 @@ static void marker_line(void *user, int xa, int ya, int xb, int yb)
return;
if (!ok_a && !ok_b)
return;
+ aalineColor(s, ax - TEE_MARK * nx, ay - TEE_MARK * ny,
+ ax + TEE_MARK * nx, ay + TEE_MARK * ny, MARKER_LINE_RGBA);
+ aalineColor(s, bx - TEE_MARK * nx, by - TEE_MARK * ny,
+ bx + TEE_MARK * nx, by + TEE_MARK * ny, MARKER_LINE_RGBA);
aalineColor(s, ax, ay, bx, by, MARKER_LINE_RGBA);
}