diff options
author | Valerio Mariani <valerio.mariani@desy.de> | 2015-02-20 19:08:20 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-02-21 00:12:24 +0100 |
commit | b407e8c61b0060716c08a84b876fdee9f9ec52af (patch) | |
tree | 61af2ea3e5f287e8b1f8e9d409c6442a893df082 /src/geoptimiser.c | |
parent | 7b8593424fd230182ca67e320e35159c76066c12 (diff) |
Fix the bug in geoptimiser which prevented the optimization of quadrants as connected panels
Diffstat (limited to 'src/geoptimiser.c')
-rw-r--r-- | src/geoptimiser.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/geoptimiser.c b/src/geoptimiser.c index 26e083e6..1fd55126 100644 --- a/src/geoptimiser.c +++ b/src/geoptimiser.c @@ -1279,16 +1279,16 @@ static void shift_panels(struct rg_collection *connected, struct panel *p0; double connected_panel_dist; + double delta_x, delta_y; p0 = connected->rigid_groups[di]->panels[0]; - connected_panel_dist = modulus2d( - p->cnx-p0->cnx/conn_data[di].cstr, - p->cny-p0->cny/conn_data[di].cstr - ); + delta_x = (p->cnx-p0->cnx)/conn_data[di].cstr; + delta_y = (p->cny-p0->cny)/conn_data[di].cstr; + + p->cnx = p0->cnx + delta_x; + p->cny = p0->cny + delta_y; - p->cnx = p0->cnx + connected_panel_dist*p0->fsx; - p->cny = p0->cny + connected_panel_dist*p0->fsy; } } } |