diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-02-05 03:53:22 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-02-05 03:53:22 +0000 |
commit | ca73084fad58044f6219fce2e5d0c497f4bbeac0 (patch) | |
tree | 2d11693734771c7211b33cb8e3da78e09adb4f23 /pango/pango-layout.c | |
parent | d75a6af20ecaf1cfb76c723b2e626d850e0d6d1e (diff) | |
download | pango-ca73084fad58044f6219fce2e5d0c497f4bbeac0.tar.gz |
Bug 324408 – tab can result in 0 characters
2006-02-04 Behdad Esfahbod <behdad@gnome.org>
Bug 324408 – tab can result in 0 characters
* pango/pango-layout.c (shape_tab): Make sure there is
at least an space-width of space between tab-aligned text
and the text before it.
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 8e006284..ba555b8c 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -2566,7 +2566,6 @@ get_tab_pos (PangoLayout *layout, int index) } else { - ensure_tab_width (layout); tab_width = layout->tab_width; } @@ -2576,7 +2575,6 @@ get_tab_pos (PangoLayout *layout, int index) { /* No tab array set, so use default tab width */ - ensure_tab_width (layout); return layout->tab_width * index; } } @@ -2606,7 +2604,7 @@ static void shape_tab (PangoLayoutLine *line, PangoGlyphString *glyphs) { - int i; + int i, space_width; int current_width = line_width (line); @@ -2619,10 +2617,13 @@ shape_tab (PangoLayoutLine *line, glyphs->log_clusters[0] = 0; + ensure_tab_width (line->layout); + space_width = line->layout->tab_width / 8; + for (i=0;;i++) { int tab_pos = get_tab_pos (line->layout, i); - if (tab_pos > current_width) + if (tab_pos >= current_width + space_width) { glyphs->glyphs[0].geometry.width = tab_pos - current_width; break; |