widget: Fix snapshot condition
authorTimm Bäder <mail@baedert.org>
Thu, 29 Mar 2018 07:00:48 +0000 (09:00 +0200)
committerTimm Bäder <mail@baedert.org>
Fri, 30 Mar 2018 21:15:04 +0000 (23:15 +0200)
Of course, we only need to snapshot if both width and height > 0,
otherwise the result is invisible.

gtk/gtkwidget.c

index e2f1826cbc7295afbf6d2f5e714387b4575f866c..fec5fd8c487e1a134b8fa10b271c0cd404999277 100644 (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));