Fix display of the selection in the presence of invisible segments.

2003-01-08  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix display of
	the selection in the presence of invisible segments.
This commit is contained in:
Matthias Clasen 2003-01-08 19:00:29 +00:00 committed by Matthias Clasen
parent 57fdc73682
commit 62113a6271
6 changed files with 28 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2003-01-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix display of
the selection in the presence of invisible segments.
2003-01-07 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c (gtk_text_view_class_init): Bind C-/ and C-\

View File

@ -1,3 +1,8 @@
2003-01-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix display of
the selection in the presence of invisible segments.
2003-01-07 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c (gtk_text_view_class_init): Bind C-/ and C-\

View File

@ -1,3 +1,8 @@
2003-01-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix display of
the selection in the presence of invisible segments.
2003-01-07 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c (gtk_text_view_class_init): Bind C-/ and C-\

View File

@ -1,3 +1,8 @@
2003-01-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix display of
the selection in the presence of invisible segments.
2003-01-07 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c (gtk_text_view_class_init): Bind C-/ and C-\

View File

@ -1,3 +1,8 @@
2003-01-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix display of
the selection in the presence of invisible segments.
2003-01-07 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c (gtk_text_view_class_init): Bind C-/ and C-\

View File

@ -805,18 +805,18 @@ gtk_text_layout_draw (GtkTextLayout *layout,
line_end = line_start;
if (!gtk_text_iter_ends_line (&line_end))
gtk_text_iter_forward_to_line_end (&line_end);
byte_count = gtk_text_iter_get_line_index (&line_end);
byte_count = gtk_text_iter_get_visible_line_index (&line_end);
if (gtk_text_iter_compare (&selection_start, &line_end) <= 0 &&
gtk_text_iter_compare (&selection_end, &line_start) >= 0)
{
if (gtk_text_iter_compare (&selection_start, &line_start) >= 0)
selection_start_index = gtk_text_iter_get_line_index (&selection_start);
selection_start_index = gtk_text_iter_get_visible_line_index (&selection_start);
else
selection_start_index = -1;
if (gtk_text_iter_compare (&selection_end, &line_end) <= 0)
selection_end_index = gtk_text_iter_get_line_index (&selection_end);
selection_end_index = gtk_text_iter_get_visible_line_index (&selection_end);
else
selection_end_index = MAX(byte_count, 1);
}