Choose whichever is closer to the current rotation.
Snap ssn = sn;
if(other.snap(ssn, limit, what))
{
- set_rotation(rotation+ssn.rotation-sn.rotation-Angle::half_turn());
+ if(what==SNAP_NODE)
+ set_rotation(rotation+ssn.rotation-sn.rotation-Angle::half_turn());
+ else
+ {
+ Angle adiff = wrap_balanced((ssn.rotation-sn.rotation)*2.0f)/2.0f;
+ set_rotation(rotation+adiff);
+ }
sn = get_snap_node(i);
- position += ssn.position-sn.position;
+ set_position(position+ssn.position-sn.position);
return true;
}
}