[gtk+/wip/matthiasc/gadget: 8/16] gadget: Be more forgiving to size inconsistencies
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/gadget: 8/16] gadget: Be more forgiving to size inconsistencies
- Date: Mon, 7 Dec 2015 16:07:34 +0000 (UTC)
commit 19dee8458e36af8e2d1db7bd45b7ac486f8ddbdf
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 4 07:52:18 2015 -0500
gadget: Be more forgiving to size inconsistencies
Instead of asserting if we hit negative content sizes,
warn and continue. This is easier to work with in this
transition period.
gtk/gtkcssgadget.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index b7a9707..5f83a60 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -468,8 +468,17 @@ gtk_css_gadget_allocate (GtkCssGadget *gadget,
if (baseline >= 0)
baseline += extents.top;
- g_assert (content_allocation.width >= 0);
- g_assert (content_allocation.height >= 0);
+ if (content_allocation.width < 0)
+ {
+ g_warning ("Negative content width while allocating gadget\n");
+ content_allocation.width = 0;
+ }
+
+ if (content_allocation.height < 0)
+ {
+ g_warning ("Negative content height while allocating gadget\n");
+ content_allocation.width = 0;
+ }
GTK_CSS_GADGET_GET_CLASS (gadget)->allocate (gadget, &content_allocation, baseline, &content_clip);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]