summaryrefslogtreecommitdiff
path: root/gtk/gtkthemingbackground.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-01-11 14:58:52 +0100
committerBenjamin Otte <otte@redhat.com>2012-01-11 15:48:54 +0100
commit6100900e1ae3ae30a813476d2779efa501ca974f (patch)
tree0d4010e56df2afa0caefed87006b40c95ccf95b7 /gtk/gtkthemingbackground.c
parenta815f102993a6a6f12179f9a5bd666980855e8be (diff)
downloadgtk+-6100900e1ae3ae30a813476d2779efa501ca974f.tar.gz
themingengine: Don't draw background image if no area
If the background positioning area is empty (width/height <=0), don't attempt to draw the background image.
Diffstat (limited to 'gtk/gtkthemingbackground.c')
-rw-r--r--gtk/gtkthemingbackground.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c
index a022c9d0eb..2d5859f540 100644
--- a/gtk/gtkthemingbackground.c
+++ b/gtk/gtkthemingbackground.c
@@ -83,6 +83,8 @@ _gtk_theming_background_apply_origin (GtkThemingBackground *bg)
break;
}
+ /* XXX: image_rect might have negative width/height here.
+ * Do we need to do something about it? */
bg->image_rect = image_rect;
}
@@ -123,7 +125,9 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
gdk_cairo_set_source_rgba (cr, &bg->bg_color);
cairo_paint (cr);
- if (bg->image)
+ if (bg->image
+ && bg->image_rect.width > 0
+ && bg->image_rect.height > 0)
{
GtkCssBackgroundRepeat hrepeat, vrepeat;
double image_width, image_height;