[pango] [layout] Don't break line on LINE_SEPARATOR if the line is to be ellipsized
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Subject: [pango] [layout] Don't break line on LINE_SEPARATOR if the line is to be ellipsized
- Date: Tue, 7 Apr 2009 14:34:37 -0400 (EDT)
commit 5ea040faf98de83101d50d1dfa141cdaf0cc5c2f
Author: Behdad Esfahbod <behdad behdad org>
Date: Mon Apr 6 19:46:49 2009 -0400
[layout] Don't break line on LINE_SEPARATOR if the line is to be ellipsized
---
pango/pango-layout.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index e6f0b4d..364e453 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 ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]