summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-05-02 05:40:52 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-05-02 05:40:52 +0000
commitdd259bd7098054220c14103a6f4af0b09a3ed8d6 (patch)
treec97a95d5436ab22eec9e97a36ad46b0bbc8d5958
parentdf31a6e8b10f236c4fee69e9ded7590d29da9cdf (diff)
downloadpango-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
-rw-r--r--ChangeLog5
-rw-r--r--pango/pango-layout.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 79856f7a..b10344ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
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.
+
+2007-05-02 Behdad Esfahbod <behdad@gnome.org>
+
* pango/pango-layout.c (process_line),
(pango_layout_line_postprocess): Add a "wrapped" argument to
pango_layout_line_postprocess(). Going to use it for eg whether we
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;