diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-12-09 23:05:31 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-12-09 23:05:31 (GMT) |
commit | ae42314dc1118ef6ad2da5396aa01b46aba40c3e (patch) | |
tree | 4d8f72a905f2549e6863016ff29c1cf37e0531b8 /src/glibext | |
parent | 7d0353a8482c7c9842f9077816b75e6c9229139d (diff) |
Fixed a bug by ensuring a Cairo surface is defined before painting it.
Diffstat (limited to 'src/glibext')
-rw-r--r-- | src/glibext/gbufferline.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c index 4f021fa..2680dae 100644 --- a/src/glibext/gbufferline.c +++ b/src/glibext/gbufferline.c @@ -1470,6 +1470,7 @@ void g_buffer_line_remove_flag(GBufferLine *line, BufferLineFlags flag) void g_buffer_line_draw(GBufferLine *line, cairo_t *cairo, const gint max_widths[BLC_COUNT], gint x_init, gint y, const bool *display, const segcnt_list *list) { GBufferLineClass *class; /* Stockage de briques de base */ + bool has_src_surface; /* Note une présence définie */ gint x; /* Point de départ d'impression*/ BufferLineColumn i; /* Boucle de parcours */ gint max_width; /* Largeur maximale de colonne */ @@ -1479,11 +1480,20 @@ void g_buffer_line_draw(GBufferLine *line, cairo_t *cairo, const gint max_widths class = G_BUFFER_LINE_GET_CLASS(line); if (line->flags & BLF_ENTRYPOINT) + { cairo_set_source_surface(cairo, class->entrypoint_img, 5, y); + has_src_surface = true; + } else if (line->flags & BLF_BOOKMARK) + { cairo_set_source_surface(cairo, class->bookmark_img, 5, y); + has_src_surface = true; + } + else + has_src_surface = false; - cairo_paint(cairo); + if (has_src_surface) + cairo_paint(cairo); } |