forked from AuroraMiddleware/gtk
themingbackground: Avoid erroring cairo context
This commit is contained in:
parent
396ae8f1de
commit
ab1699510e
@ -304,9 +304,6 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
|
||||
"background-repeat", &repeat,
|
||||
NULL);
|
||||
|
||||
/* Fill background color first */
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
if (cairo_pattern_get_surface (bg->pattern, &surface) != CAIRO_STATUS_SUCCESS)
|
||||
surface = NULL;
|
||||
|
||||
@ -327,6 +324,11 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
|
||||
scale_height = bg->image_rect.height;
|
||||
}
|
||||
|
||||
if (scale_width && scale_height)
|
||||
{
|
||||
/* Fill background color first */
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
cairo_translate (cr, bg->image_rect.x, bg->image_rect.y);
|
||||
cairo_scale (cr, scale_width, scale_height);
|
||||
cairo_set_source (cr, bg->pattern);
|
||||
@ -338,6 +340,7 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
|
||||
cairo_pattern_destroy (bg->pattern);
|
||||
bg->pattern = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user