GtkTextView: Preserve the cairo context around draw_layer
Otherwise, draw_layer might unintentionally wreak havoc on the regular drawing that happens between the two draw_layer calls.
This commit is contained in:
parent
7450277708
commit
7d55355d4d
@ -5328,12 +5328,20 @@ draw_text (cairo_t *cr,
|
||||
gtk_style_context_restore (context);
|
||||
|
||||
if (GTK_TEXT_VIEW_GET_CLASS (text_view)->draw_layer != NULL)
|
||||
GTK_TEXT_VIEW_GET_CLASS (text_view)->draw_layer (text_view, GTK_TEXT_VIEW_LAYER_BELOW, cr);
|
||||
{
|
||||
cairo_save (cr);
|
||||
GTK_TEXT_VIEW_GET_CLASS (text_view)->draw_layer (text_view, GTK_TEXT_VIEW_LAYER_BELOW, cr);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
gtk_text_view_paint (widget, cr);
|
||||
|
||||
if (GTK_TEXT_VIEW_GET_CLASS (text_view)->draw_layer != NULL)
|
||||
GTK_TEXT_VIEW_GET_CLASS (text_view)->draw_layer (text_view, GTK_TEXT_VIEW_LAYER_ABOVE, cr);
|
||||
{
|
||||
cairo_save (cr);
|
||||
GTK_TEXT_VIEW_GET_CLASS (text_view)->draw_layer (text_view, GTK_TEXT_VIEW_LAYER_ABOVE, cr);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user