From 2c46baf30c9b6a8fe2af529f5fcbe02c514cdca7 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Thu, 29 Mar 2012 14:35:50 +0200 Subject: [PATCH] canvas: avoid emission of "draw" signal when the size is zero This also avoids the warning Cogl-WARNING **: ./cogl-buffer.c:215: GL error (1285): Out of memory generated by cogl_buffer_map when the CoglBuffer has zero length. --- clutter/clutter-canvas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-canvas.c b/clutter/clutter-canvas.c index 7913936e1..b77af5555 100644 --- a/clutter/clutter-canvas.c +++ b/clutter/clutter-canvas.c @@ -333,7 +333,7 @@ clutter_canvas_emit_draw (ClutterCanvas *self) gboolean res; cairo_t *cr; - g_assert (priv->width >= 0 && priv->width >= 0); + g_assert (priv->width > 0 && priv->width > 0); if (priv->buffer == NULL) { @@ -411,7 +411,7 @@ clutter_canvas_invalidate (ClutterContent *content) priv->buffer = NULL; } - if (priv->width < 0 || priv->height < 0) + if (priv->width <= 0 || priv->height <= 0) return; clutter_canvas_emit_draw (self);