diff options
author | Timm Bäder <mail@baedert.org> | 2019-01-13 07:23:10 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2019-01-13 08:39:05 +0100 |
commit | 69bc42f44441bd0f71a496faa5379a588ad52aac (patch) | |
tree | f74211f9f10e711862c15a6a9045704a11631b13 /gtk/gtkrendernodepaintable.c | |
parent | 269535c844e9a6fdc1286472e72c0d1f8ff3123c (diff) | |
download | gtk+-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.
Diffstat (limited to 'gtk/gtkrendernodepaintable.c')
-rw-r--r-- | gtk/gtkrendernodepaintable.c | 4 |
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; |