Commit 782c2762 authored by Matthias Clasen's avatar Matthias Clasen

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.
parent a52c3a3d
......@@ -451,8 +451,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment