From 9a8a82600092dbdd69f905d90538e09c7c297f57 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 9 Aug 2007 21:00:50 +0000 Subject: =?UTF-8?q?Bug=20465174=20=E2=80=93=20TextView=20is=20ignoring=20m?= =?UTF-8?q?ultiple=20consecutive=20\t's?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2007-08-09 Behdad Esfahbod Bug 465174 – TextView is ignoring multiple consecutive \t's * pango/pango-layout.c (get_tab_pos), (shape_tab): Fix two problems introduced with fix for bug 464183. The code now semantically matches what it was before changes leading to revision 1734 for the case that user has set no tabs. svn path=/trunk/; revision=2394 --- pango/pango-layout.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'pango') diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 843e4fde..02e27db3 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -2823,18 +2823,19 @@ get_tab_pos (PangoLayout *layout, int index, gboolean *is_default) gint n_tabs; gboolean in_pixels; - if (is_default) - *is_default = FALSE; - if (layout->tabs) { n_tabs = pango_tab_array_get_size (layout->tabs); in_pixels = pango_tab_array_get_positions_in_pixels (layout->tabs); + if (is_default) + *is_default = FALSE; } else { n_tabs = 0; in_pixels = FALSE; + if (is_default) + *is_default = TRUE; } if (index < n_tabs) @@ -2886,9 +2887,6 @@ get_tab_pos (PangoLayout *layout, int index, gboolean *is_default) { /* No tab array set, so use default tab width */ - if (is_default) - *is_default = FALSE; - return layout->tab_width * index; } } @@ -2944,7 +2942,7 @@ shape_tab (PangoLayoutLine *line, * tab positions. If use has set tab positions, respect it to * the pixel. */ - if (tab_pos >= current_width + (is_default ? space_width : 0)) + if (tab_pos >= current_width + (is_default ? space_width : 1)) { glyphs->glyphs[0].geometry.width = tab_pos - current_width; break; -- cgit v1.2.1