• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revision3c79ed5c731d35da21bd2458d16ffce0a8738be7 (tree)
Time2014-09-08 00:25:25
AuthorHans Breuer <hans@breu...>
CommiterHans Breuer

Log Message

[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.

Change Summary

Incremental Difference

--- a/lib/orth_conn.c
+++ b/lib/orth_conn.c
@@ -106,6 +106,7 @@ autoroute_create_change(OrthConn *orth, gboolean on);
106106 struct AutorouteChange {
107107 ObjectChange obj_change;
108108 gboolean on;
109+ int num_points;
109110 Point *points;
110111 };
111112
@@ -1193,7 +1194,8 @@ autoroute_change_apply(struct AutorouteChange *change, DiaObject *obj)
11931194 obj->handles[1]->connected_to);
11941195 } else {
11951196 orth->autorouting = FALSE;
1196- orthconn_set_points(orth, orth->numpoints, change->points);
1197+ orthconn_set_points(orth, change->num_points, change->points);
1198+ /* adjust the rest of the object? nope, see: object_change_revert() */
11971199 }
11981200 }
11991201
@@ -1204,7 +1206,7 @@ autoroute_change_revert(struct AutorouteChange *change, DiaObject *obj)
12041206
12051207 if (change->on) {
12061208 orth->autorouting = FALSE;
1207- orthconn_set_points(orth, orth->numpoints, change->points);
1209+ orthconn_set_points(orth, change->num_points, change->points);
12081210 } else {
12091211 orth->autorouting = TRUE;
12101212 autoroute_layout_orthconn(orth, obj->handles[0]->connected_to,
@@ -1225,6 +1227,7 @@ autoroute_create_change(OrthConn *orth, gboolean on)
12251227 change->obj_change.free = (ObjectChangeFreeFunc) autoroute_change_free;
12261228
12271229 change->on = on;
1230+ change->num_points = orth->numpoints;
12281231 change->points = g_new(Point, orth->numpoints);
12291232 for (i = 0; i < orth->numpoints; i++)
12301233 change->points[i] = orth->points[i];