summaryrefslogtreecommitdiff
path: root/pango/break.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-04-24 03:37:20 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-04-24 03:37:20 +0000
commit744df757571eb00e6766b450d941ccfe9b70b68f (patch)
tree423924e5c2b4819421451e725bf8e1a05e1bdbd8 /pango/break.c
parent3f3fc34bed071b73bd43bcec98edad6b81fcdf90 (diff)
downloadpango-744df757571eb00e6766b450d941ccfe9b70b68f.tar.gz
New function for visual (left-right, not forward-back) cursor navigation
Sun Apr 23 23:33:10 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_move_cursor_visually): New function for visual (left-right, not forward-back) cursor navigation within a layout. Thu Apr 20 22:16:39 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_line_x_to_index): As a hack, for x-positions at the edge of a line, fudge the position to be one before the line end (which is, for programs that don't properly handle the trailing flag), instead of at the end of the line. This works fine for whitespace-broken languages, but won't work right for languages that don't use whitespace to break lines. (GtkText* needs to keep track of whether a cursor is trailing or not) * pango/pango-layout.c (pango_layout_check_lines): Prohibit breaking a line at a non-whitespace -> space transition. (So that we never put wrap single character of whitespace at the beginning of a line) * pango/break.c (pango_break): Always allow a break before the first char. * pango/pango-layout.c (pango_layout_line_x_to_index): Remove the return value from the function, make it return the appropriate index depending on the base direction of the layoutt.
Diffstat (limited to 'pango/break.c')
-rw-r--r--pango/break.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pango/break.c b/pango/break.c
index 811d5482..b171b087 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -49,7 +49,7 @@ void pango_break (const gchar *text,
{
next = unicode_get_utf8 (cur, &wc);
if (!next)
- return; /* FIXME: ERROR */
+ break; /* FIXME: ERROR */
if (cur == next)
break;
if ((next - text) > length)
@@ -57,7 +57,7 @@ void pango_break (const gchar *text,
cur = next;
attrs[i].is_white = (wc == ' ' || wc == '\t' || wc == '\n') ? 1 : 0;
- attrs[i].is_break = (i > 0 && attrs[i-1].is_white) || attrs[i].is_white;
+ attrs[i].is_break = i == 0 || attrs[i-1].is_white || attrs[i].is_white;
attrs[i].is_char_stop = 1;
attrs[i].is_word_stop = (i == 0) || attrs[i-1].is_white;