diff options
| author | Tim Dwyer <tgdwyer@gmail.com> | 2006-07-17 02:25:52 +0000 |
|---|---|---|
| committer | tgdwyer <tgdwyer@users.sourceforge.net> | 2006-07-17 02:25:52 +0000 |
| commit | 6de3190ff1b9655ebce6f915b963ab1a10ad2cfe (patch) | |
| tree | ea20bdd0d815e78ee25c51931a9c8dc519f14bfc /src/graphlayout/graphlayout.cpp | |
| parent | more string cleanup (diff) | |
| download | inkscape-6de3190ff1b9655ebce6f915b963ab1a10ad2cfe.tar.gz inkscape-6de3190ff1b9655ebce6f915b963ab1a10ad2cfe.zip | |
Constraints are now properly divided up between the connected components
(bzr r1424)
Diffstat (limited to 'src/graphlayout/graphlayout.cpp')
| -rw-r--r-- | src/graphlayout/graphlayout.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/graphlayout/graphlayout.cpp b/src/graphlayout/graphlayout.cpp index 72c47d9bf..ec5c780c7 100644 --- a/src/graphlayout/graphlayout.cpp +++ b/src/graphlayout/graphlayout.cpp @@ -91,7 +91,7 @@ void graphlayout(GSList const *const items) { rs.push_back(new Rectangle(ll[0],ur[0],ll[1],ur[1])); } - SimpleConstraints scy; + SimpleConstraints scx,scy; double ideal_connector_length = prefs_get_double_attribute("tools.connector","length",100); double directed_edge_height_modifier = 1.0; gchar const *directed_str = NULL, *overlaps_str = NULL; @@ -154,7 +154,7 @@ void graphlayout(GSList const *const items) { double eweights[E]; fill(eweights,eweights+E,1); vector<Component*> cs; - connectedComponents(rs,es,cs); + connectedComponents(rs,es,scx,scy,cs); for(unsigned i=0;i<cs.size();i++) { Component* c=cs[i]; printf("Component %d:\n",i); @@ -166,7 +166,7 @@ void graphlayout(GSList const *const items) { cout << endl; ConstrainedMajorizationLayout alg(c->rects,c->edges,eweights,ideal_connector_length); alg.setupConstraints(NULL,NULL,avoid_overlaps, - NULL,NULL,NULL,&scy,NULL,NULL); + NULL,NULL,&c->scx,&c->scy,NULL,NULL); alg.run(); } @@ -183,6 +183,15 @@ void graphlayout(GSList const *const items) { sp_item_move_rel(u, NR::translate(dest - curr)); } } + for(unsigned i=0;i<scx.size();i++) { + delete scx[i]; + } + for(unsigned i=0;i<scy.size();i++) { + delete scy[i]; + } + for(unsigned i=0;i<rs.size();i++) { + delete rs[i]; + } } // vim: set cindent // vim: ts=4 sw=4 et tw=0 wm=0 |
