summaryrefslogtreecommitdiff
path: root/gtk/gtktextlayout.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-06-28 02:46:11 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-06-28 02:46:11 +0000
commit86e4f7d1f305574a1d7e412efc56db8d02f23eb2 (patch)
treef8d4b7daf4ca5f925cbb9c0e3a792d2840007af4 /gtk/gtktextlayout.c
parente93418a1638f3ee62e40e9978a81965b48752052 (diff)
downloadgtk+-86e4f7d1f305574a1d7e412efc56db8d02f23eb2.tar.gz
Fix positioning at the end of the line for lines ending in invisible
2005-06-27 Matthias Clasen <mclasen@redhat.com> * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end): Fix positioning at the end of the line for lines ending in invisible characters. (gtk_text_layout_get_line_display): Set display->layout to a PangoLayout, even for totally invisible lines.
Diffstat (limited to 'gtk/gtktextlayout.c')
-rw-r--r--gtk/gtktextlayout.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index a44bf785be..3a564c42ba 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -1847,7 +1847,14 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
* with sequences of invisible lines.
*/
if (totally_invisible_line (layout, line, &iter))
- return display;
+ {
+ if (display->direction == GTK_TEXT_DIR_RTL)
+ display->layout = pango_layout_new (layout->rtl_context);
+ else
+ display->layout = pango_layout_new (layout->ltr_context);
+
+ return display;
+ }
/* Find the bidi base direction */
base_dir = line->dir_propagated_forward;
@@ -2955,9 +2962,10 @@ gtk_text_layout_move_iter_to_line_end (GtkTextLayout *layout,
* are inside a paragraph to avoid going to next line on a
* forced break not at whitespace. Real fix is to keep track
* of whether marks are at leading or trailing edge? */
- if (direction > 0 && layout_line->length > 0 && !gtk_text_iter_ends_line (iter))
+ if (direction > 0 && layout_line->length > 0 &&
+ !gtk_text_iter_ends_line (iter) &&
+ !_gtk_text_btree_char_is_invisible (iter))
gtk_text_iter_backward_char (iter);
-
break;
}