[gtksourceview] SpaceDrawer: cairo_stroke() each character



commit 01a993eba151906ce33e37ed5f00fd93b54e370c
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Oct 19 14:34:05 2016 +0200

    SpaceDrawer: cairo_stroke() each character
    
    draw_nbsp_at_pos() already called cairo_fill() or cairo_stroke(). In
    case of cairo_fill() (for a narrowed nbsp), it affected the previous
    char. So now, cairo_stroke() is called for each character, so that
    drawing a character doesn't affect the drawing of another.
    
    There is a screenshot of the bug at:
    https://bugzilla.gnome.org/show_bug.cgi?id=773214

 gtksourceview/gtksourcespacedrawer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcespacedrawer.c b/gtksourceview/gtksourcespacedrawer.c
index df5251e..db1ec0d 100644
--- a/gtksourceview/gtksourcespacedrawer.c
+++ b/gtksourceview/gtksourcespacedrawer.c
@@ -968,6 +968,7 @@ draw_space_at_pos (cairo_t      *cr,
        cairo_save (cr);
        cairo_move_to (cr, x + w * 0.5, y);
        cairo_arc (cr, x + w * 0.5, y, 0.8, 0, 2 * G_PI);
+       cairo_stroke (cr);
        cairo_restore (cr);
 }
 
@@ -990,6 +991,7 @@ draw_tab_at_pos (cairo_t      *cr,
        cairo_rel_line_to (cr, -h * 1 / 4, -h * 1 / 4);
        cairo_rel_move_to (cr, +h * 1 / 4, +h * 1 / 4);
        cairo_rel_line_to (cr, -h * 1 / 4, +h * 1 / 4);
+       cairo_stroke (cr);
        cairo_restore (cr);
 }
 
@@ -1007,6 +1009,7 @@ draw_newline_at_pos (cairo_t      *cr,
        h = rect.height;
 
        cairo_save (cr);
+
        if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_LTR)
        {
                cairo_move_to (cr, x + w * 7 / 8, y);
@@ -1026,6 +1029,7 @@ draw_newline_at_pos (cairo_t      *cr,
                cairo_rel_line_to (cr, -h * 1 / 4, -h * 1 / 4);
        }
 
+       cairo_stroke (cr);
        cairo_restore (cr);
 }
 
@@ -1452,7 +1456,6 @@ _gtk_source_space_drawer_draw (GtkSourceSpaceDrawer *drawer,
                }
        };
 
-       cairo_stroke (cr);
        cairo_restore (cr);
 
 #ifdef ENABLE_PROFILE


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