[gtksourceview] Add a comment about drawing the line background



commit ce77292588703a7c24ef5092b864333843d68513
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Sep 10 16:31:45 2013 +0200

    Add a comment about drawing the line background
    
    Since the bug is closed, it's better to keep this information in the
    code, in case someone has the same idea in the future (to avoid
    repeating history).

 gtksourceview/gtksourceview.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 94f4356..c225ee1 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -1694,6 +1694,15 @@ gtk_source_view_get_lines (GtkTextView  *text_view,
        *countp = count;
 }
 
+/* Another solution to paint the line background is to use the
+ * GtkTextTag:paragraph-background property. But there are several issues:
+ * - GtkTextTags are per buffer, not per view. It's better to keep the line
+ *   highlighting per view.
+ * - There is a problem for empty lines: a text tag can not be applied to an
+ *   empty region. And it can not be worked around easily for the last line.
+ *
+ * See https://bugzilla.gnome.org/show_bug.cgi?id=310847 for more details.
+ */
 static void
 gtk_source_view_paint_line_background (GtkTextView    *text_view,
                                       cairo_t        *cr,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]