sizerequest: Add more assertions for baselines

min baselines must be <= natural baselines and both must lie inside the
content size of the widget.
This commit is contained in:
Timm Bäder
2017-07-04 11:35:06 +02:00
committed by Matthias Clasen
parent cef4df1e7e
commit 6a7d903612

View File

@@ -305,6 +305,18 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
min_baseline = -1;
nat_baseline = -1;
}
else if (min_baseline > reported_min_size ||
nat_baseline > reported_nat_size ||
min_baseline < 0 ||
nat_baseline < 0)
{
g_warning ("%s %p reported baselines of minimum %d and natural %d, but sizes of "
"minimum %d and natural %d. Baselines must be inside the widget size.",
G_OBJECT_TYPE_NAME (widget), widget, min_baseline, nat_baseline,
reported_min_size, reported_nat_size);
min_baseline = -1;
nat_baseline = -1;
}
else
{
if (css_min_size > reported_min_size)