summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-07-16 11:46:54 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-07-16 11:46:54 +0000
commitbc5be9fd1d9c8d89ed65e7e351117474f69b3983 (patch)
treea677225d54a32694607201c466655e49d0559d44
parent6b78072f12a63f2a48a81a08baae812b539df8ee (diff)
downloadpango-bc5be9fd1d9c8d89ed65e7e351117474f69b3983.tar.gz
#143601: Felipe Heidrich
Fri Jul 16 07:43:04 2004 Owen Taylor <otaylor@redhat.com> #143601: Felipe Heidrich * pango/pango-layout.c (pango_layout_line_x_to_index): Go into painful detail about the behavior for X positions outside the line. * pango/pango-layout.c (pango_layout_xy_to_index): Add some more details about handling of positions outside the layout, reference pango_layout_line_x_to_index().
-rw-r--r--ChangeLog13
-rw-r--r--ChangeLog.pre-1-1013
-rw-r--r--ChangeLog.pre-1-613
-rw-r--r--ChangeLog.pre-1-813
-rw-r--r--pango/pango-layout.c23
5 files changed, 68 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 63b711fb..66e12ebe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Fri Jul 16 07:43:04 2004 Owen Taylor <otaylor@redhat.com>
+
+ #143601: Felipe Heidrich
+
+ * pango/pango-layout.c (pango_layout_line_x_to_index):
+ Go into painful detail about the behavior for X positions
+ outside the line.
+
+ * pango/pango-layout.c (pango_layout_xy_to_index):
+ Add some more details about handling of positions
+ outside the layout, reference
+ pango_layout_line_x_to_index().
+
Thu Jul 15 10:48:01 2004 Owen Taylor <otaylor@redhat.com>
* pango/pangofc-font.c (pango_fc_font_get_glyph): Replace
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 63b711fb..66e12ebe 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,16 @@
+Fri Jul 16 07:43:04 2004 Owen Taylor <otaylor@redhat.com>
+
+ #143601: Felipe Heidrich
+
+ * pango/pango-layout.c (pango_layout_line_x_to_index):
+ Go into painful detail about the behavior for X positions
+ outside the line.
+
+ * pango/pango-layout.c (pango_layout_xy_to_index):
+ Add some more details about handling of positions
+ outside the layout, reference
+ pango_layout_line_x_to_index().
+
Thu Jul 15 10:48:01 2004 Owen Taylor <otaylor@redhat.com>
* pango/pangofc-font.c (pango_fc_font_get_glyph): Replace
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 63b711fb..66e12ebe 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,16 @@
+Fri Jul 16 07:43:04 2004 Owen Taylor <otaylor@redhat.com>
+
+ #143601: Felipe Heidrich
+
+ * pango/pango-layout.c (pango_layout_line_x_to_index):
+ Go into painful detail about the behavior for X positions
+ outside the line.
+
+ * pango/pango-layout.c (pango_layout_xy_to_index):
+ Add some more details about handling of positions
+ outside the layout, reference
+ pango_layout_line_x_to_index().
+
Thu Jul 15 10:48:01 2004 Owen Taylor <otaylor@redhat.com>
* pango/pangofc-font.c (pango_fc_font_get_glyph): Replace
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 63b711fb..66e12ebe 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,16 @@
+Fri Jul 16 07:43:04 2004 Owen Taylor <otaylor@redhat.com>
+
+ #143601: Felipe Heidrich
+
+ * pango/pango-layout.c (pango_layout_line_x_to_index):
+ Go into painful detail about the behavior for X positions
+ outside the line.
+
+ * pango/pango-layout.c (pango_layout_xy_to_index):
+ Add some more details about handling of positions
+ outside the layout, reference
+ pango_layout_line_x_to_index().
+
Thu Jul 15 10:48:01 2004 Owen Taylor <otaylor@redhat.com>
* pango/pangofc-font.c (pango_fc_font_get_glyph): Replace
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index fe8ef25d..3cfa641e 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -1421,10 +1421,12 @@ pango_layout_move_cursor_visually (PangoLayout *layout,
*
* Converts from X and Y position within a layout to the byte
* index to the character at that logical position. If the
- * position is not inside the layout, the closest position is chosen
- * (the x/y position will be clamped inside the layout).
- * If a closest position is chosen, then the function returns %FALSE;
- * on an exact hit, it returns %TRUE.
+ * Y position is not inside the layout, the closest position is chosen
+ * (the position will be clamped inside the layout). If the
+ * X position is not within the layout, then the start or the
+ * end of the line is chosen as described for pango_layout_x_to_index().
+ * If either the X or Y positions were not inside the layout, then the
+ * function returns %FALSE; on an exact hit, it returns %TRUE.
*
* Return value: %TRUE if the coordinates were inside text
**/
@@ -3288,16 +3290,23 @@ pango_layout_line_unref (PangoLayoutLine *line)
* @line: a #PangoLayoutLine
* @x_pos: the x offset (in #PangoGlyphUnit)
* from the left edge of the line.
- * @index_: location to store calculated byte offset for
+ * @index_: location to store calculated byte index for
* the grapheme in which the user clicked.
* @trailing: location to store a integer indicating where
* in the grapheme the user clicked. It will either
* be zero, or the number of characters in the
- * grapheme. 0 represents the trailing edge of the cluster.
+ * grapheme. 0 represents the trailing edge of the grapheme.
*
* Converts from x offset to the byte index of the corresponding
* character within the text of the layout. If @x_pos is outside the line,
- * the start or end of the line will be stored at @index_.
+ * @index_ and @trailing will point to the very first or very last position
+ * in the line. This determination is based on the resolved direction
+ * of the paragraph; for example, if the resolved direction is
+ * right-to-left, then an X position to the right of the line (after it)
+ * results in 0 being stored in @index_ and @trailing. An X position to the
+ * left of the line results in @index_ pointing to the (logical) last
+ * grapheme in the line and @trailing being set to the number of characters
+ * in that grapheme. The reverse is true for a left-to-right line.
*
* Returns: %FALSE if @x_pos was outside the line, %TRUE if inside
**/