widget: Fix snapshot condition

Of course, we only need to snapshot if both width and height > 0,
otherwise the result is invisible.
This commit is contained in:
Timm Bäder 2018-03-29 09:00:48 +02:00
parent 60acbd1090
commit 66d5a4f752

View File

@ -13902,7 +13902,7 @@ gtk_widget_snapshot (GtkWidget *widget,
/* Offset to content allocation */
gtk_snapshot_offset (snapshot, margin.left + padding.left + border.left, margin.top + border.top + padding.top);
if (gtk_widget_get_width (widget) > 0 || gtk_widget_get_height (widget) > 0)
if (gtk_widget_get_width (widget) > 0 && gtk_widget_get_height (widget) > 0)
klass->snapshot (widget, snapshot);
gtk_snapshot_offset (snapshot, - (margin.left + padding.left + border.left), -(margin.top + border.top + padding.top));