]> Pileus Git - ~andy/gtk/commitdiff
cssimage: Add a warning for drawing empty images
authorBenjamin Otte <otte@redhat.com>
Fri, 26 Oct 2012 23:31:59 +0000 (01:31 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 31 Oct 2012 10:09:10 +0000 (11:09 +0100)
width and height of an image must be > 0 for the image to get drawn.
It's up to the code further up to ensure that this is not happening.

gtk/gtkcssimage.c

index abe95ae6c01cfc1ee8b33035d0140d3f21f84e8a..167af64a9117b02624ab0cfcef6d88bd49651ccb 100644 (file)
@@ -229,6 +229,8 @@ _gtk_css_image_draw (GtkCssImage        *image,
 
   g_return_if_fail (GTK_IS_CSS_IMAGE (image));
   g_return_if_fail (cr != NULL);
+  g_return_if_fail (width > 0);
+  g_return_if_fail (height > 0);
 
   cairo_save (cr);