From 90bfcc1fbd8bb53508dc93405add1d8aacb4e7ed Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 30 Nov 2019 14:53:22 +0100 Subject: render: fix underline/strikeout positioning There were two errors: * We subtracted half the line width instead of adding it to the baseline * We rounded the line positioning and thickness before the positioning calculation. In particular, rounding the thickness before using it to adjust the position was wrong. Now we round just before the pixman call. --- font.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'font.h') diff --git a/font.h b/font.h index a01416dc..1a94067a 100644 --- a/font.h +++ b/font.h @@ -53,13 +53,13 @@ struct font { int max_x_advance; struct { - int position; - int thickness; + double position; + double thickness; } underline; struct { - int position; - int thickness; + double position; + double thickness; } strikeout; bool is_fallback; -- cgit v1.3