diff options
author | Tor Lillqvist <tml@novell.com> | 2005-07-22 08:10:05 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-07-22 08:10:05 +0000 |
commit | fd847a61ca5e079d0d3456a685d65bf59a0b5c76 (patch) | |
tree | c33fe01384861ce2546631439ec724aa1e971596 | |
parent | b7a52d72e5730aafc65d3526b1d2a8e98812f9f7 (diff) | |
download | pango-fd847a61ca5e079d0d3456a685d65bf59a0b5c76.tar.gz |
Fix underlining. (#304692) Mention in the doc comment that the DC's text
2005-07-22 Tor Lillqvist <tml@novell.com>
* pango/pangowin32.c (pango_win32_render_layout_line): Fix
underlining. (#304692) Mention in the doc comment that the DC's
text alignment needs to have TA_BASELINE and TA_LEFT for
underlining to be correct.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 7 | ||||
-rw-r--r-- | pango/pangowin32.c | 12 |
3 files changed, 23 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2005-07-22 Tor Lillqvist <tml@novell.com> + + * pango/pangowin32.c (pango_win32_render_layout_line): Fix + underlining. (#304692) Mention in the doc comment that the DC's + text alignment needs to have TA_BASELINE and TA_LEFT for + underlining to be correct. + 2005-07-21 Owen Taylor <otaylor@redhat.com> * modules/indic/indic-ot.c: Minor formatting tweak to license diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 2b001b31..ce66fbbe 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,10 @@ +2005-07-22 Tor Lillqvist <tml@novell.com> + + * pango/pangowin32.c (pango_win32_render_layout_line): Fix + underlining. (#304692) Mention in the doc comment that the DC's + text alignment needs to have TA_BASELINE and TA_LEFT for + underlining to be correct. + 2005-07-21 Owen Taylor <otaylor@redhat.com> * modules/indic/indic-ot.c: Minor formatting tweak to license 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: |