[dia] Bug 607655 - Arcs are badly exported (sometimes)
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Bug 607655 - Arcs are badly exported (sometimes)
- Date: Sat, 15 May 2010 19:47:58 +0000 (UTC)
commit 364517a6c6eb91e89764aee689196210d3bc399e
Author: Hans Breuer <hans breuer org>
Date: Sun Jan 24 21:06:39 2010 +0100
Bug 607655 - Arcs are badly exported (sometimes)
The large-arc flag was not correctly calculated for angle1>angle2
lib/diasvgrenderer.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/lib/diasvgrenderer.c b/lib/diasvgrenderer.c
index fd10f13..94fd431 100644
--- a/lib/diasvgrenderer.c
+++ b/lib/diasvgrenderer.c
@@ -420,7 +420,7 @@ draw_arc(DiaRenderer *self,
real ex=center->x + rx*cos(angle2*G_PI/180);
real ey=center->y - ry*sin(angle2*G_PI/180);
int swp = 0; /* always drawin negative direction */
- int large_arc = (angle2 - angle1 >= 180);
+ int large_arc;
gchar sx_buf[DTOSTR_BUF_SIZE];
gchar sy_buf[DTOSTR_BUF_SIZE];
gchar rx_buf[DTOSTR_BUF_SIZE];
@@ -428,6 +428,10 @@ draw_arc(DiaRenderer *self,
gchar ex_buf[DTOSTR_BUF_SIZE];
gchar ey_buf[DTOSTR_BUF_SIZE];
+ if (angle1 > angle2)
+ angle2 += 360;
+ large_arc = (angle2 - angle1 >= 180);
+
node = xmlNewChild(renderer->root, renderer->svg_name_space, (const xmlChar *)"path", NULL);
xmlSetProp(node, (const xmlChar *)"style", (xmlChar *) get_draw_style(renderer, colour));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]