From b407e8c61b0060716c08a84b876fdee9f9ec52af Mon Sep 17 00:00:00 2001 From: Valerio Mariani Date: Fri, 20 Feb 2015 19:08:20 +0100 Subject: Fix the bug in geoptimiser which prevented the optimization of quadrants as connected panels --- src/geoptimiser.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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; } } } -- cgit v1.2.3