Added a more accurate way to detect rotated boxes. This fixed a bug with creating connections between boxes.