dia r4317 - in trunk: . plug-ins/cairo



Author: hans
Date: Fri Mar 13 22:32:26 2009
New Revision: 4317
URL: http://svn.gnome.org/viewvc/dia?rev=4317&view=rev

Log:
2009-03-13  Hans Breuer  <hans breuer org>

	* plug-ins/cairo/diacairo.c : rather than using broken ellipse 
	approximation convert to translate/scale/arc dance, fixes bug #574868


Modified:
   trunk/ChangeLog
   trunk/plug-ins/cairo/diacairo-renderer.c

Modified: trunk/plug-ins/cairo/diacairo-renderer.c
==============================================================================
--- trunk/plug-ins/cairo/diacairo-renderer.c	(original)
+++ trunk/plug-ins/cairo/diacairo-renderer.c	Fri Mar 13 22:32:26 2009
@@ -534,6 +534,14 @@
 
   cairo_set_source_rgba (renderer->cr, color->red, color->green, color->blue, 1.0);
   
+#if 1
+  cairo_save (renderer->cr);
+  /* copied straight from cairo's documentation, and fixed the bug there */
+  cairo_translate (renderer->cr, center->x, center->y);
+  cairo_scale (renderer->cr, width / 2., height / 2.);
+  cairo_arc (renderer->cr, 0., 0., 1., 0., 2 * G_PI);
+  cairo_restore (renderer->cr);
+#else
   /* FIXME: how to make a perfect ellipse from a bezier ? */
   co = sqrt(pow(width,2)/4 + pow(height,2)/4);
 
@@ -548,6 +556,8 @@
                   center->x - co, center->y + height/2,
                   center->x - co, center->y - height/2,
                   center->x, center->y - height/2);
+#endif
+
   if (fill)
     cairo_fill (renderer->cr);
   else



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