diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-08-09 21:00:50 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-08-09 21:00:50 +0000 |
commit | 9a8a82600092dbdd69f905d90538e09c7c297f57 (patch) | |
tree | 7798ee92ff3674430f1f6f9fb9bfdb5d1163f800 | |
parent | 680b368540838b7ed801329cb6550011f5bb1a55 (diff) | |
download | pango-9a8a82600092dbdd69f905d90538e09c7c297f57.tar.gz |
Bug 465174 – TextView is ignoring multiple consecutive \t's
2007-08-09 Behdad Esfahbod <behdad@gnome.org>
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
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | pango/pango-layout.c | 12 |
2 files changed, 14 insertions, 7 deletions
@@ -1,3 +1,12 @@ +2007-08-09 Behdad Esfahbod <behdad@gnome.org> + + 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. + 2007-08-08 Behdad Esfahbod <behdad@gnome.org> * docs/check.docs: Fix typo. 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; |