summaryrefslogtreecommitdiff
path: root/pango/pango-renderer.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-08-19 23:53:52 +0200
committerMatthias Clasen <mclasen@redhat.com>2019-10-31 21:23:59 -0400
commitfc2aa99b829f9539d91b6036f1d148a17cc91a61 (patch)
tree485544d7cdb87c0c8c54500b223554de994f420f /pango/pango-renderer.c
parent215b1ed9b72fe5b1c55b42bf0440bf1ba045cf84 (diff)
downloadpango-fc2aa99b829f9539d91b6036f1d148a17cc91a61.tar.gz
renderer: Handle new underline values
Handle these by using the lowest position across a sequence of runs with the same underline. Closes: https://gitlab.gnome.org/GNOME/pango/issues/62
Diffstat (limited to 'pango/pango-renderer.c')
-rw-r--r--pango/pango-renderer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index 889989dd..df1eb538 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -216,6 +216,7 @@ draw_underline (PangoRenderer *renderer,
case PANGO_UNDERLINE_NONE:
break;
case PANGO_UNDERLINE_DOUBLE:
+ case PANGO_UNDERLINE_DOUBLE_LINE:
pango_renderer_draw_rectangle (renderer,
PANGO_RENDER_PART_UNDERLINE,
rect->x,
@@ -225,6 +226,7 @@ draw_underline (PangoRenderer *renderer,
/* Fall through */
case PANGO_UNDERLINE_SINGLE:
case PANGO_UNDERLINE_LOW:
+ case PANGO_UNDERLINE_SINGLE_LINE:
pango_renderer_draw_rectangle (renderer,
PANGO_RENDER_PART_UNDERLINE,
rect->x,
@@ -233,6 +235,7 @@ draw_underline (PangoRenderer *renderer,
rect->height);
break;
case PANGO_UNDERLINE_ERROR:
+ case PANGO_UNDERLINE_ERROR_LINE:
pango_renderer_draw_error_underline (renderer,
rect->x,
rect->y,
@@ -326,6 +329,18 @@ add_underline (PangoRenderer *renderer,
case PANGO_UNDERLINE_LOW:
new_rect.y += ink_rect->y + ink_rect->height + underline_thickness;
break;
+ case PANGO_UNDERLINE_SINGLE_LINE:
+ case PANGO_UNDERLINE_DOUBLE_LINE:
+ case PANGO_UNDERLINE_ERROR_LINE:
+ new_rect.y -= underline_position;
+ if (state->underline == renderer->underline)
+ {
+ new_rect.y = MAX (current_rect->y, new_rect.y);
+ new_rect.height = MAX (current_rect->height, new_rect.height);
+ current_rect->y = new_rect.y;
+ current_rect->height = new_rect.height;
+ }
+ break;
}
if (renderer->underline == state->underline &&