[gtksourceview] view: remove border from current line highlight



commit 14138828a26a232ddde9f39afd4ea9328eb991d5
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 20 15:44:01 2021 -0700

    view: remove border from current line highlight
    
    This is problematic in that it only works when RGBA is used since it
    essentially just draws the RGBA twice in some areas. We want to use
    premixed colors as much as we can across the board and remove the use of
    snapshot_background() too.
    
    Therefore, we'll drop the extra border, and replicate it further in the
    gutter so they match.
    
    Doing so will not only give us faster rendering, but a fighting chance at
    fixing #29 in GTK 4/GtkSourceView 5 based applications.

 gtksourceview/gtksourceview.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 6fd55d37..a525223f 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2407,19 +2407,12 @@ gtk_source_view_paint_line_background (GtkSourceView *view,
                                        int            height,
                                        const GdkRGBA *color)
 {
-       static const float widths[4] = { 1, 0, 1, 0 };
        GtkSourceViewPrivate *priv = gtk_source_view_get_instance_private (view);
-       GdkRGBA colors[4] = { *color, *color, *color, *color };
        GdkRectangle visible_rect;
 
+       g_assert (GTK_SOURCE_IS_VIEW (view));
+
        gtk_text_view_get_visible_rect (GTK_TEXT_VIEW (view), &visible_rect);
-       gtk_snapshot_append_border (snapshot,
-                                   &GSK_ROUNDED_RECT_INIT (visible_rect.x,
-                                                           y,
-                                                           visible_rect.width,
-                                                           height),
-                                   widths,
-                                   colors);
        gtk_snapshot_append_color (snapshot,
                                   color,
                                   &GRAPHENE_RECT_INIT (visible_rect.x,


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