summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2019-01-13 07:23:10 +0100
committerTimm Bäder <mail@baedert.org>2019-01-13 08:39:05 +0100
commit69bc42f44441bd0f71a496faa5379a588ad52aac (patch)
treef74211f9f10e711862c15a6a9045704a11631b13
parent269535c844e9a6fdc1286472e72c0d1f8ff3123c (diff)
downloadgtk+-69bc42f44441bd0f71a496faa5379a588ad52aac.tar.gz
rendernodepaintable: Don't try to snapshot 0×0 nodes
Considering the operations that some of the rendernode constructors do, nodes with width or height 0 (or both of course) are very well possible. This would break in the rendernodepaintable when adding a transform, which divides by width/height of the rendernode.
-rw-r--r--gtk/gtkrendernodepaintable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkrendernodepaintable.c b/gtk/gtkrendernodepaintable.c
index 7ee40b138b..8e67150a37 100644
--- a/gtk/gtkrendernodepaintable.c
+++ b/gtk/gtkrendernodepaintable.c
@@ -45,6 +45,10 @@ gtk_render_node_paintable_paintable_snapshot (GdkPaintable *paintable,
GtkRenderNodePaintable *self = GTK_RENDER_NODE_PAINTABLE (paintable);
gboolean needs_transform;
+ if (self->bounds.size.width <= 0 ||
+ self->bounds.size.height <= 0)
+ return;
+
needs_transform = self->bounds.size.width != width ||
self->bounds.size.height != height;