summaryrefslogtreecommitdiff
path: root/meme/marker.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/marker.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/marker.c')
-rw-r--r--meme/marker.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/meme/marker.c b/meme/marker.c
index bedb638..31d679a 100644
--- a/meme/marker.c
+++ b/meme/marker.c
@@ -28,7 +28,8 @@ struct mark {
void marker_draw(const struct marker *marker,
- void (*line)(void *user, int xa, int ya, int xb, int yb),
+ void (*line)(void *user, int xa, int ya, int xb, int yb,
+ float nx, float ny),
void (*text)(void *user, int x, int y, float nx, float ny, const char *txt),
void *user)
{
@@ -46,7 +47,8 @@ void marker_draw(const struct marker *marker,
d = hypotf(dx, dy);
x = (mark->xa + mark->xb) / 2.0;
y = (mark->ya + mark->yb) / 2.0;
- line(user, mark->xa, mark->ya, mark->xb, mark->yb);
+ line(user, mark->xa, mark->ya, mark->xb, mark->yb,
+ dy / d, -dx / d);
text(user, x, y, dy / d, -dx / d, mark->s);
}
}