summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-12-19 21:39:26 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-12-19 21:39:26 +0000
commit4f4e1748e219f431550a0a804c9d3fc4267e97ef (patch)
tree2ecd8abcf1ae0df025547b0f24b6f96f545b931f /pango
parent6c32653f32d11d24d2cfb20337076b652525fe54 (diff)
downloadpango-4f4e1748e219f431550a0a804c9d3fc4267e97ef.tar.gz
Bug 326099 – Setting width, indentation and ellipsizing doesn't work as
2006-12-19 Behdad Esfahbod <behdad@gnome.org> Bug 326099 – Setting width, indentation and ellipsizing doesn't work as I would expect * pango/ellipsize.c (_pango_layout_line_ellipsize): Account for indentation when deciding what width to ellipsize for.
Diffstat (limited to 'pango')
-rw-r--r--pango/ellipsize.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pango/ellipsize.c b/pango/ellipsize.c
index a8ac04c9..22f6e4b4 100644
--- a/pango/ellipsize.c
+++ b/pango/ellipsize.c
@@ -723,6 +723,7 @@ _pango_layout_line_ellipsize (PangoLayoutLine *line,
PangoAttrList *attrs)
{
EllipsizeState state;
+ int goal_width;
if (line->layout->ellipsize == PANGO_ELLIPSIZE_NONE ||
line->layout->width < 0)
@@ -730,12 +731,16 @@ _pango_layout_line_ellipsize (PangoLayoutLine *line,
init_state (&state, line, attrs);
- if (state.total_width <= state.layout->width)
+ goal_width = state.layout->width;
+ if (state.layout->indent > 0 && state.layout->alignment != PANGO_ALIGN_CENTER)
+ goal_width -= state.layout->indent;
+
+ if (state.total_width <= goal_width)
goto out;
find_initial_span (&state);
- while (current_width (&state) > state.layout->width)
+ while (current_width (&state) > goal_width)
{
if (!remove_one_span (&state))
break;