d9c875
From 4ba89f25b8a88616afc1915bdb4fb87d13efae6f Mon Sep 17 00:00:00 2001
d9c875
From: Benjamin Otte <otte@redhat.com>
d9c875
Date: Tue, 15 Jun 2021 19:34:37 +0200
d9c875
Subject: [PATCH] cellarea: Don't shrink area too much
d9c875
d9c875
Do not compute rectangles with negative width/height. This avoids
d9c875
assertion failures further down when those rectangles were actually
d9c875
checked.
d9c875
d9c875
https://bugzilla.redhat.com/show_bug.cgi?id=1962215
d9c875
---
d9c875
 gtk/gtkcellarea.c | 10 ++++++++++
d9c875
 1 file changed, 10 insertions(+)
d9c875
d9c875
diff --git a/gtk/gtkcellarea.c b/gtk/gtkcellarea.c
d9c875
index 575e1c7fde..d1b3b1a279 100644
d9c875
--- a/gtk/gtkcellarea.c
d9c875
+++ b/gtk/gtkcellarea.c
d9c875
@@ -3563,8 +3563,18 @@ gtk_cell_area_inner_cell_area (GtkCellArea        *area,
d9c875
 
d9c875
   *inner_area = *cell_area;
d9c875
 
d9c875
+  if (border.left + border.right > cell_area->width)
d9c875
+    {
d9c875
+      border.left = cell_area->width / 2;
d9c875
+      border.right = (cell_area->width + 1) / 2;
d9c875
+    }
d9c875
   inner_area->x += border.left;
d9c875
   inner_area->width -= border.left + border.right;
d9c875
+  if (border.top + border.bottom > cell_area->height)
d9c875
+    {
d9c875
+      border.top = cell_area->height / 2;
d9c875
+      border.bottom = (cell_area->height + 1) / 2;
d9c875
+    }
d9c875
   inner_area->y += border.top;
d9c875
   inner_area->height -= border.top + border.bottom;
d9c875
 }
d9c875
-- 
d9c875
GitLab
d9c875