[gtk+/wip/baedert/drawing: 15/22] sizerequest: Add more assertions for baselines
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 15/22] sizerequest: Add more assertions for baselines
- Date: Tue, 4 Jul 2017 17:10:27 +0000 (UTC)
commit 81a0acbad718ec54a9eb4e72d776385d5b0fe90a
Author: Timm Bäder <mail baedert org>
Date: Tue Jul 4 11:35:06 2017 +0200
sizerequest: Add more assertions for baselines
min baselines must be <= natural baselines and both must lie inside the
content size of the widget.
gtk/gtksizerequest.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index e1baaf1..d8f3022 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -305,6 +305,24 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
min_baseline = -1;
nat_baseline = -1;
}
+ else if (min_baseline > nat_baseline)
+ {
+ g_warning ("%s %p reported a minimum baseline of %d and a natural baseline of %d."
+ "Natural baselines must be >= minimum baselines",
+ G_OBJECT_TYPE_NAME (widget), widget, min_baseline, nat_baseline);
+ min_baseline = -1;
+ nat_baseline = -1;
+ }
+ else if (min_baseline > reported_min_size ||
+ nat_baseline > reported_nat_size)
+ {
+ 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]