diff options
Diffstat (limited to 'pango/pangowin32.c')
-rw-r--r-- | pango/pangowin32.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 0b58346d..faea85d6 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -777,12 +777,14 @@ pango_win32_get_unknown_glyph (PangoFont *font, /** * pango_win32_render_layout_line: - * @hdc: HDC to use for uncolored drawing + * @hdc: DC to use for uncolored drawing * @line: a #PangoLayoutLine * @x: the x position of start of string (in pixels) * @y: the y position of baseline (in pixels) * - * Render a #PangoLayoutLine onto a device context + * Render a #PangoLayoutLine onto a device context. For underlining to + * work property the text alignment of the DC should have TA_BASELINE + * and TA_LEFT. */ void pango_win32_render_layout_line (HDC hdc, @@ -856,9 +858,13 @@ pango_win32_render_layout_line (HDC hdc, points[0].y = points[1].y = y + 4; points[1].x = x + PANGO_PIXELS (x_off + ink_rect.x + ink_rect.width); Polyline (hdc, points, 2); - /* Fall through */ + points[0].y = points[1].y = y + 2; + Polyline (hdc, points, 2); + break; case PANGO_UNDERLINE_SINGLE: + points[0].x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; points[0].y = points[1].y = y + 2; + points[1].x = x + PANGO_PIXELS (x_off + ink_rect.x + ink_rect.width); Polyline (hdc, points, 2); break; case PANGO_UNDERLINE_ERROR: |