From e1378f14338df28991c28ea6538fcb3ca6ae1d0a Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Sat, 3 Jan 2015 21:08:02 +0100 Subject: [PATCH] make labels optional --- unfold.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/unfold.c b/unfold.c index d808a1d..bf2b0d3 100644 --- a/unfold.c +++ b/unfold.c @@ -17,6 +17,7 @@ #endif static int debug = 0; +static int draw_labels = 0; typedef struct { @@ -520,7 +521,10 @@ printf("\n", const float tx = (g->p[0][0] + g->p[1][0] + g->p[2][0]) / 3.0; const float ty = (g->p[0][1] + g->p[1][1] + g->p[2][1]) / 3.0; - svg_text(tx, ty, 0, "%04x", (0x7FFFF & (uintptr_t) f) >> 3); + + if (draw_labels) + svg_text(tx, ty, 0, "%04x", + (0x7FFFF & (uintptr_t) f) >> 3); for (int i = 0 ; i < 3 ; i++) { @@ -539,7 +543,11 @@ printf("\n", const float angle = atan2(dy, dx) * 180 / M_PI; svg_line("#FF0000", p1, p2, 0); - svg_text(cx, cy, angle, "%04x", (0x7FFFF & (uintptr_t) f->next[edge]) >> 3); + + if (draw_labels) + svg_text(cx, cy, angle, "%04x", + (0x7FFFF & (uintptr_t) f->next[edge]) >> 3); + continue; }