[dia] Revert "Bezier*: fix save of BezPoint with type BEZ_LINE_TO"



commit fadc2335e849a3c8f133920deee61ff1ae196057
Author: Hans Breuer <hans breuer org>
Date:   Thu Dec 20 14:57:21 2012 +0100

    Revert "Bezier*: fix save of BezPoint with type BEZ_LINE_TO"
    
    This reverts commit 195eb75c0894815624013ccdf9b3f8b77ca63763.
    
    Not sure what I was thinking, but that code broke saving of
    curve-to by loosing the last segment. The intended fix might
    not be necessary at all anymore because of:
    
    Revision: cb3589a6ec6cc2cc3932edb684940f13f5a1ca75
    Author: Hans Breuer
    Date: 06.10.2012 21:10:06
    Message:
    Bezier*: improved handling for BEZ_LINE_TO
    
    To make editing in Dia more convenient we turn line-to to
    curve-to with cusp controls
    ----
    Modified : lib/bezier-common.c

 lib/bezier_conn.c |   11 ++---------
 lib/beziershape.c |   13 +++----------
 2 files changed, 5 insertions(+), 19 deletions(-)
---
diff --git a/lib/bezier_conn.c b/lib/bezier_conn.c
index 190bb17..ea96e95 100644
--- a/lib/bezier_conn.c
+++ b/lib/bezier_conn.c
@@ -864,15 +864,8 @@ bezierconn_save (BezierConn *bezier,
     if (BEZ_MOVE_TO == bezier->bezier.points[i].type)
       g_warning("only first BezPoint can be a BEZ_MOVE_TO");
     data_add_point(attr, &bezier->bezier.points[i].p1);
-    if (BEZ_LINE_TO == bezier->bezier.points[i].type) {
-      data_add_point(attr, &bezier->bezier.points[i].p1);
-      if (i < bezier->bezier.num_points - 1)
-        data_add_point(attr, &bezier->bezier.points[i].p1);
-    } else {
-      data_add_point(attr, &bezier->bezier.points[i].p2);
-      if (i < bezier->bezier.num_points - 1)
-        data_add_point(attr, &bezier->bezier.points[i].p3);
-    }
+    data_add_point(attr, &bezier->bezier.points[i].p2);
+    data_add_point(attr, &bezier->bezier.points[i].p3);
   }
 
   attr = new_attribute(obj_node, "corner_types");
diff --git a/lib/beziershape.c b/lib/beziershape.c
index 1c0cbde..172588d 100644
--- a/lib/beziershape.c
+++ b/lib/beziershape.c
@@ -947,16 +947,9 @@ beziershape_save (BezierShape *bezier,
     if (BEZ_MOVE_TO == bezier->bezier.points[i].type)
       g_warning("only first BezPoint can be a BEZ_MOVE_TO");
     data_add_point(attr, &bezier->bezier.points[i].p1);
-
-    if (BEZ_LINE_TO == bezier->bezier.points[i].type) {
-      data_add_point(attr, &bezier->bezier.points[i].p1);
-      if (i < bezier->bezier.num_points - 1)
-        data_add_point(attr, &bezier->bezier.points[i].p1);
-    } else {
-      data_add_point(attr, &bezier->bezier.points[i].p2);
-      if (i < bezier->bezier.num_points - 1)
-        data_add_point(attr, &bezier->bezier.points[i].p3);
-    }
+    data_add_point(attr, &bezier->bezier.points[i].p2);
+    if (i < bezier->bezier.num_points - 1)
+      data_add_point(attr, &bezier->bezier.points[i].p3);
   }
 
   attr = new_attribute(obj_node, "corner_types");


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