Revert "gsk: Stop enlarging text bounding boxes"
authorMatthias Clasen <mclasen@redhat.com>
Fri, 17 Sep 2021 23:11:06 +0000 (19:11 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 17 Sep 2021 23:11:06 +0000 (19:11 -0400)
This reverts commit 87af45403ace1047b91ddbab98d9d5a5e15b84eb.

I've found that this change is needed to ensure that the
bounding boxes of text nodes encompass all the glyphd drawing.
Without it, we overdraw the widget boundaries and cut off
glyphs.

gsk/gskrendernodeimpl.c

index 18cbcd185afb6729a619bcd659406941340cd98b..fd2a9e5d4422136636f27faff0e96d0c85f36a54 100644 (file)
@@ -4477,10 +4477,10 @@ gsk_text_node_new (PangoFont              *font,
   self->num_glyphs = n;
 
   graphene_rect_init (&node->bounds,
-                      offset->x + ink_rect.x,
-                      offset->y + ink_rect.y,
-                      ink_rect.width,
-                      ink_rect.height);
+                      offset->x + ink_rect.x - 1,
+                      offset->y + ink_rect.y - 1,
+                      ink_rect.width + 2,
+                      ink_rect.height + 2);
 
   return node;
 }