summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-08-09 21:00:50 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-08-09 21:00:50 +0000
commit9a8a82600092dbdd69f905d90538e09c7c297f57 (patch)
tree7798ee92ff3674430f1f6f9fb9bfdb5d1163f800 /pango
parent680b368540838b7ed801329cb6550011f5bb1a55 (diff)
downloadpango-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
Diffstat (limited to 'pango')
-rw-r--r--pango/pango-layout.c12
1 files changed, 5 insertions, 7 deletions
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;