[dia] cairo: bug 683700 - don't screw cairo's matrix by scaling with 0



commit 49fb1a8638bc932b726add6cabb6b4dab3296ca7
Author: Hans Breuer <hans breuer org>
Date:   Fri Sep 14 19:29:15 2012 +0200

    cairo: bug 683700 - don't screw cairo's matrix by scaling with 0
    
    Seen with the VDX attached to bug 683700 - maybe there is also
    something wrong with the import?

 plug-ins/cairo/diacairo-renderer.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/cairo/diacairo-renderer.c b/plug-ins/cairo/diacairo-renderer.c
index 15be076..3e731f3 100644
--- a/plug-ins/cairo/diacairo-renderer.c
+++ b/plug-ins/cairo/diacairo-renderer.c
@@ -641,8 +641,14 @@ _ellipse(DiaRenderer *self,
   DIAG_NOTE(g_message("%s_ellipse %fx%f center @ %f,%f", 
             fill ? "fill" : "draw", width, height, center->x, center->y));
 
+  /* avoid screwing cairo context - I'd say restore should fix it again, but it doesn't
+   * (dia.exe:3152): DiaCairo-WARNING **: diacairo-renderer.c:254, invalid matrix (not invertible)
+   */
+  if (!(width > 0. && height > 0.))
+    return;
+
   cairo_set_source_rgba (renderer->cr, color->red, color->green, color->blue, color->alpha);
-  
+
   cairo_save (renderer->cr);
   /* don't create a line from the current point to the beginning 
    * of the ellipse */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]