[dia] Bug 312641 - fix some remaining miscalculations with arcs
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Bug 312641 - fix some remaining miscalculations with arcs
- Date: Sun, 26 Jun 2011 10:48:31 +0000 (UTC)
commit 14a1d80d55ec529804c3cc5d8e0914c2cbaf7799
Author: Hans Breuer <hans breuer org>
Date: Fri Jun 24 12:08:57 2011 +0200
Bug 312641 - fix some remaining miscalculations with arcs
Some conditions still/again produced vanishing of arcs.
lib/diarenderer.c | 2 +-
objects/standard/arc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index 55b1ec9..67b740f 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -1367,7 +1367,7 @@ draw_arc_with_arrows (DiaRenderer *renderer,
}
/* Only draw it if the original direction is preserved */
- if ((angle2 > angle1) == clockwise)
+ if (is_right_hand (&new_startpoint, midpoint, &new_endpoint) == righthand)
DIA_RENDERER_GET_CLASS(renderer)->draw_arc(renderer, ¢er, width, width,
angle1, angle2, color);
diff --git a/objects/standard/arc.c b/objects/standard/arc.c
index 4e585f6..9900c07 100644
--- a/objects/standard/arc.c
+++ b/objects/standard/arc.c
@@ -758,7 +758,7 @@ arc_update_data(Arc *arc)
y2 = endpoints[1].y;
lensq = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
- if (arc->curve_distance > 0.01)
+ if (fabs(arc->curve_distance) > 0.01)
radius = lensq/(8*arc->curve_distance) + arc->curve_distance/2.0;
else
radius = 0.0; /* not really but used for bbox calculation below */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]