diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-05-02 05:40:52 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-05-02 05:40:52 +0000 |
commit | dd259bd7098054220c14103a6f4af0b09a3ed8d6 (patch) | |
tree | c97a95d5436ab22eec9e97a36ad46b0bbc8d5958 /pango | |
parent | df31a6e8b10f236c4fee69e9ded7590d29da9cdf (diff) | |
download | pango-dd259bd7098054220c14103a6f4af0b09a3ed8d6.tar.gz |
Keep track of line start_offset in break state.
2007-05-02 Behdad Esfahbod <behdad@gnome.org>
* pango/pango-layout.c (process_line), (pango_layout_check_lines):
Keep track of line start_offset in break state.
svn path=/trunk/; revision=2247
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-layout.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 8470ab55..e6128576 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -2989,7 +2989,8 @@ struct _ParaBreakState GList *items; /* This paragraph turned into items */ PangoDirection base_dir; /* Current resolved base direction */ gboolean first_line; /* TRUE if this is the first line of the paragraph */ - int line_start_index; /* Start index of line in layout->text */ + int line_start_index; /* Start index (byte offset) of line in layout->text */ + int line_start_offset; /* Character offset of line in layout->text */ int remaining_width; /* Amount of space remaining on line; < 0 is infinite */ @@ -3408,6 +3409,7 @@ process_line (PangoLayout *layout, layout->lines = g_slist_prepend (layout->lines, line); state->first_line = FALSE; state->line_start_index += line->length; + state->line_start_offset = state->start_offset; } static void @@ -3647,6 +3649,7 @@ pango_layout_check_lines (PangoLayout *layout) state.first_line = TRUE; state.base_dir = base_dir; state.start_offset = start_offset; + state.line_start_offset = start_offset; state.line_start_index = start - layout->text; state.glyphs = NULL; |