summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-24 13:44:21 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-24 13:44:21 (GMT)
commite9d9db519f29a9a0262089af0e2b8cd4514abacd (patch)
tree0bc39f716a2d325199fd0d65d93fda59c6e8a250 /gfx
parenta20353e1b16d936ca6c31362d56e0af545c3424d (diff)
downloadeeshow-e9d9db519f29a9a0262089af0e2b8cd4514abacd.zip
eeshow-e9d9db519f29a9a0262089af0e2b8cd4514abacd.tar.gz
eeshow-e9d9db519f29a9a0262089af0e2b8cd4514abacd.tar.bz2
gfx/cro.c (overlined): render ~~ as single tilde, without affecting overlining
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 823ad4f..3ff5d2e 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -275,16 +275,25 @@ static void overlined(cairo_t *cr, const char *s, double h)
if (*s == '~') {
cairo_show_glyphs(cr, last, g - last);
last = g + 1;
- if (overlining) {
- overline(cr, ox, oy, g->x, g->y, h);
- } else {
- ox = g->x;
- oy = g->y;
- }
- overlining = !overlining;
- if (s[1]) {
+ if (s[1] == '~') { /* ~~ -> render ~ */
off_x = g[0].x - g[1].x;
off_y = g[0].y - g[1].y;
+ g++;
+ s++;
+ g->x += off_x;
+ g->y += off_y;
+ } else {
+ if (overlining) {
+ overline(cr, ox, oy, g->x, g->y, h);
+ } else {
+ ox = g->x;
+ oy = g->y;
+ }
+ overlining = !overlining;
+ if (s[1]) {
+ off_x = g[0].x - g[1].x;
+ off_y = g[0].y - g[1].y;
+ }
}
}
g++;