[gtk/backports-for-4-2: 2/7] cellarea: Don't shrink area too much
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/backports-for-4-2: 2/7] cellarea: Don't shrink area too much
- Date: Fri, 18 Jun 2021 17:23:32 +0000 (UTC)
commit 5ab6eca84da3637bbec6630dc534589f174225b2
Author: Benjamin Otte <otte redhat com>
Date: Tue Jun 15 19:34:37 2021 +0200
cellarea: Don't shrink area too much
Do not compute rectangles with negative width/height. This avoids
assertion failures further down when those rectangles were actually
checked.
https://bugzilla.redhat.com/show_bug.cgi?id=1962215
(cherry picked from commit 4ba89f25b8a88616afc1915bdb4fb87d13efae6f)
gtk/gtkcellarea.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkcellarea.c b/gtk/gtkcellarea.c
index 549dc8ec1d..0af47a3112 100644
--- a/gtk/gtkcellarea.c
+++ b/gtk/gtkcellarea.c
@@ -3424,8 +3424,18 @@ gtk_cell_area_inner_cell_area (GtkCellArea *area,
*inner_area = *cell_area;
+ if (border.left + border.right > cell_area->width)
+ {
+ border.left = cell_area->width / 2;
+ border.right = (cell_area->width + 1) / 2;
+ }
inner_area->x += border.left;
inner_area->width -= border.left + border.right;
+ if (border.top + border.bottom > cell_area->height)
+ {
+ border.top = cell_area->height / 2;
+ border.bottom = (cell_area->height + 1) / 2;
+ }
inner_area->y += border.top;
inner_area->height -= border.top + border.bottom;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]