diff options
-rw-r--r-- | src/geoptimiser.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/geoptimiser.c b/src/geoptimiser.c index 73ca3081..ed62767f 100644 --- a/src/geoptimiser.c +++ b/src/geoptimiser.c @@ -1311,12 +1311,13 @@ static void shift_panels(struct rg_collection *connected, p0 = connected->rigid_groups[di]->panels[0]; - 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; + 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 * cos(conn_data[di].cang) + - delta_y * sin(conn_data[di].cang); + p->cny = p0->cny + delta_x * sin(conn_data[di].cang) + + delta_y * cos(conn_data[di].cang); } } } |