Fixed bug in BoxPrimitive::calc_signed_dist()