[gtk+] cssimage: Add a warning for drawing empty images
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cssimage: Add a warning for drawing empty images
- Date: Wed, 31 Oct 2012 10:57:47 +0000 (UTC)
commit 016647edb188386c62d76d2c684a46ad37fa097b
Author: Benjamin Otte <otte redhat com>
Date: Sat Oct 27 01:31:59 2012 +0200
cssimage: Add a warning for drawing empty images
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 | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssimage.c b/gtk/gtkcssimage.c
index abe95ae..167af64 100644
--- a/gtk/gtkcssimage.c
+++ b/gtk/gtkcssimage.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]