summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/glibext/gbufferline.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f3c0d37..6e1f813 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+15-12-10 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/glibext/gbufferline.c:
+ Fix a bug by ensuring a Cairo surface is defined before painting it.
+
15-12-09 Cyrille Bagard <nocbos@gmail.com>
* src/glibext/gbufferline.c:
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);
}