summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-04-06 19:46:49 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-04-06 19:46:49 -0400
commit5ea040faf98de83101d50d1dfa141cdaf0cc5c2f (patch)
treeca139275e13ef43f9ca2c22984ec273a10e9722d /pango/pango-layout.c
parentcaabe183c7747d7486695071ab592e677bbdce25 (diff)
downloadpango-5ea040faf98de83101d50d1dfa141cdaf0cc5c2f.tar.gz
[layout] Don't break line on LINE_SEPARATOR if the line is to be ellipsized
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index e6f0b4d0..364e4537 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3109,6 +3109,10 @@ struct _ParaBreakState
int remaining_width; /* Amount of space remaining on line; < 0 is infinite */
};
+static gboolean
+should_ellipsize_current_line (PangoLayout *layout,
+ ParaBreakState *state);
+
static PangoGlyphString *
shape_run (PangoLayoutLine *line,
ParaBreakState *state,
@@ -3245,7 +3249,8 @@ process_item (PangoLayout *layout,
}
if (!layout->single_paragraph &&
- g_utf8_get_char (layout->text + item->offset) == LINE_SEPARATOR)
+ g_utf8_get_char (layout->text + item->offset) == LINE_SEPARATOR &&
+ !should_ellipsize_current_line (layout, state))
{
insert_run (line, state, item, TRUE);
state->log_widths_offset += item->num_chars;
@@ -3654,7 +3659,7 @@ pango_layout_get_effective_attributes (PangoLayout *layout)
PangoAttrList *attrs;
if (layout->attrs)
- attrs = pango_attr_list_copy (layout->attrs);
+ attrs = pango_attr_list_copy (layout->attrs);
else
attrs = pango_attr_list_new ();