mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 16:30:15 +00:00
layoutoverlay: Avoid adding transparent color nodes
We have a region for the border here, but the color is defined as transparent black because we don't want to render anything for it. This way, the generated .node file for the listbox demo in gtk4-demo with enabled layout borders is 3.5MB instead of 3.8MB.
This commit is contained in:
parent
2feac2772f
commit
c34f98931e
@ -107,6 +107,9 @@ recurse_child_widgets (GtkWidget *widget,
|
||||
const GdkRGBA *color = &colors[i];
|
||||
const GtkBorder *box = &boxes[i];
|
||||
|
||||
if (gdk_rgba_is_clear (color))
|
||||
goto next;
|
||||
|
||||
if (box->top > 0)
|
||||
gtk_snapshot_append_color (snapshot, color,
|
||||
&GRAPHENE_RECT_INIT ( 0, - box->top, width, box->top));
|
||||
@ -120,6 +123,7 @@ recurse_child_widgets (GtkWidget *widget,
|
||||
gtk_snapshot_append_color (snapshot, color,
|
||||
&GRAPHENE_RECT_INIT (- box->left, 0, box->left, height));
|
||||
|
||||
next:
|
||||
/* Grow box + offset */
|
||||
width += box->left + box->right;
|
||||
height += box->top + box->bottom;
|
||||
|
Loading…
Reference in New Issue
Block a user