summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-01-15 20:52:36 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-01-15 20:52:36 +0000
commit1adb39880caba26073ee5af697891332676f3294 (patch)
tree77bdcd9e51a2bdcb1dc706bcf5de3159b92fbfc1
parent0dc3f0629dfb710cdada8d753dce61ec97879986 (diff)
downloadpango-1adb39880caba26073ee5af697891332676f3294.tar.gz
Minor cleanup.
2008-01-15 Behdad Esfahbod <behdad@gnome.org> * pango/pango-layout.c (debug), (process_line), (pango_layout_line_postprocess): Minor cleanup. svn path=/trunk/; revision=2545
-rw-r--r--ChangeLog5
-rw-r--r--pango/pango-layout.c30
2 files changed, 19 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index c9c9cf47..0006c571 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-01-15 Behdad Esfahbod <behdad@gnome.org>
+ * pango/pango-layout.c (debug), (process_line),
+ (pango_layout_line_postprocess): Minor cleanup.
+
+2008-01-15 Behdad Esfahbod <behdad@gnome.org>
+
Bug 469313 – Add pango_layout_set_height()
* pango/pango-layout.c (get_x_offset),
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 21acb10a..235f0731 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3104,19 +3104,7 @@ insert_run (PangoLayoutLine *line,
void
debug (const char *where, PangoLayoutLine *line, ParaBreakState *state)
{
- int line_width = 0;
-
- GSList *tmp_list;
-
- tmp_list = line->runs;
- while (tmp_list)
- {
- PangoLayoutRun *run = tmp_list->data;
-
- line_width += pango_glyph_string_get_width (run->glyphs);
-
- tmp_list = tmp_list->next;
- }
+ int line_width = pango_layout_line_get_width (line);
g_message ("rem %d + line %d = %d %s",
state->remaining_width,
@@ -3511,12 +3499,20 @@ process_line (PangoLayout *layout,
case BREAK_LINE_SEPARATOR:
state->items = g_list_delete_link (state->items, state->items);
state->start_offset += old_num_chars;
+ /* FIXME We don't set wrapped here. Which means we don't justify
+ * lines that end in a line separator. Not sure which behavior is
+ * more desired. For now that we do greedy line breaking, not
+ * justifying lines of potentially very small length is a good idea,
+ * but when we do a better job at that, if there's a different
+ * between line separator and paragraph separator, it should be that
+ * line separator acts just like a forced break, with no effect on
+ * justification.
+ */
goto done;
}
}
done:
- layout->is_wrapped |= wrapped;
pango_layout_line_postprocess (line, state, wrapped);
add_line (line, state);
state->line_of_par++;
@@ -5091,8 +5087,7 @@ pango_layout_line_postprocess (PangoLayoutLine *line,
if (G_UNLIKELY (state->line_width >= 0 &&
should_ellipsize_current_line (line->layout, state)))
{
- ellipsized = _pango_layout_line_ellipsize (line, state->attrs, state->line_width);
- line->layout->is_ellipsized |= ellipsized;
+ ellipsized = _pango_layout_line_ellipsize (line, state->attrs, state->line_width);
}
/* Truncate the logical-final whitespace in the line if we broke the line at it
@@ -5126,6 +5121,9 @@ pango_layout_line_postprocess (PangoLayoutLine *line,
}
DEBUG ("after justification", line, state);
+
+ line->layout->is_wrapped |= wrapped;
+ line->layout->is_ellipsized |= ellipsized;
}
static void