[dia] [autorouting] Toggling autorouting and undo, fix number of points
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [autorouting] Toggling autorouting and undo, fix number of points
- Date: Sun, 7 Sep 2014 16:55:38 +0000 (UTC)
commit 3c79ed5c731d35da21bd2458d16ffce0a8738be7
Author: Hans Breuer <hans breuer org>
Date: Sun Sep 7 17:25:25 2014 +0200
[autorouting] Toggling autorouting and undo, fix number of points
The recent crash fixed with c865c8b87e0cd774c75131d913ac53bfd156c69b had
also some visible effect when toggling auorouting for a fresh D&D
"UML - Component Feature". Switching the autorouting of again by undo did
not restore the original number of points, because taht wasn't stored with
the change information.
lib/orth_conn.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/lib/orth_conn.c b/lib/orth_conn.c
index 5c0956c..e7d5247 100644
--- a/lib/orth_conn.c
+++ b/lib/orth_conn.c
@@ -106,6 +106,7 @@ autoroute_create_change(OrthConn *orth, gboolean on);
struct AutorouteChange {
ObjectChange obj_change;
gboolean on;
+ int num_points;
Point *points;
};
@@ -1193,7 +1194,8 @@ autoroute_change_apply(struct AutorouteChange *change, DiaObject *obj)
obj->handles[1]->connected_to);
} else {
orth->autorouting = FALSE;
- orthconn_set_points(orth, orth->numpoints, change->points);
+ orthconn_set_points(orth, change->num_points, change->points);
+ /* adjust the rest of the object? nope, see: object_change_revert() */
}
}
@@ -1204,7 +1206,7 @@ autoroute_change_revert(struct AutorouteChange *change, DiaObject *obj)
if (change->on) {
orth->autorouting = FALSE;
- orthconn_set_points(orth, orth->numpoints, change->points);
+ orthconn_set_points(orth, change->num_points, change->points);
} else {
orth->autorouting = TRUE;
autoroute_layout_orthconn(orth, obj->handles[0]->connected_to,
@@ -1225,6 +1227,7 @@ autoroute_create_change(OrthConn *orth, gboolean on)
change->obj_change.free = (ObjectChangeFreeFunc) autoroute_change_free;
change->on = on;
+ change->num_points = orth->numpoints;
change->points = g_new(Point, orth->numpoints);
for (i = 0; i < orth->numpoints; i++)
change->points[i] = orth->points[i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]