summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2019-11-02 01:45:49 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2019-11-02 01:45:49 +0200
commit6c58f52269a368160a7c21fe38b81a775587c3bf (patch)
treef630c4dc9acd6267aeb009fe722a0ac3e4477048
parent2099fcf52b4f33da77c9fe11210ee3c2c927c449 (diff)
downloadpango-6c58f52269a368160a7c21fe38b81a775587c3bf.tar.gz
Don’t use underline position in overlines
This matches what web browsers do. Fixes https://gitlab.gnome.org/GNOME/pango/issues/432
-rw-r--r--pango/pango-layout.c4
-rw-r--r--pango/pango-renderer.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 2c069269..df47f0f6 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -4983,8 +4983,8 @@ pango_layout_run_get_extents_and_height (PangoLayoutRun *run,
if (properties.oline_single)
{
- run_ink->y -= underline_thickness - underline_position;
- run_ink->height += underline_thickness - underline_position;
+ run_ink->y -= underline_thickness;
+ run_ink->height += underline_thickness;
}
if (properties.uline_low)
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index 8180fbf3..6c0786c5 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -411,7 +411,6 @@ add_overline (PangoRenderer *renderer,
PangoRectangle *current_rect = &state->overline_rect;
PangoRectangle new_rect;
int underline_thickness = pango_font_metrics_get_underline_thickness (metrics);
- int underline_position = pango_font_metrics_get_underline_position (metrics);
int ascent = pango_font_metrics_get_ascent (metrics);
new_rect.x = base_x + logical_rect->x;
@@ -425,7 +424,7 @@ add_overline (PangoRenderer *renderer,
g_assert_not_reached ();
break;
case PANGO_OVERLINE_SINGLE:
- new_rect.y -= ascent + underline_position;
+ new_rect.y -= ascent;
if (state->overline == renderer->overline)
{
new_rect.y = MIN (current_rect->y, new_rect.y);