Don't try to snapshot invisible icons

These spew criticals when width == 0 || height == 0.
This commit is contained in:
Timm Bäder 2017-10-09 17:38:54 +02:00
parent f50832864e
commit 657983cfda
3 changed files with 13 additions and 8 deletions

View File

@ -43,6 +43,7 @@ gtk_icon_snapshot (GtkWidget *widget,
gtk_widget_get_content_size (widget, &width, &height);
if (width > 0 && height > 0)
gtk_css_style_snapshot_icon (style,
snapshot,
width, height,

View File

@ -1476,6 +1476,7 @@ gtk_paned_render_handle (GtkGizmo *gizmo,
gtk_widget_get_content_size (widget, &width, &height);
if (width > 0 && height > 0)
gtk_css_style_snapshot_icon (style,
snapshot,
width, height,

View File

@ -105,6 +105,9 @@ gtk_css_style_snapshot_icon (GtkCssStyle *style,
g_return_if_fail (GTK_IS_CSS_STYLE (style));
g_return_if_fail (snapshot != NULL);
if (width == 0.0 || height == 0.0)
return;
image = _gtk_css_image_value_get_image (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SOURCE));
if (image == NULL)
return;