Improve offscreen detection logic

Discriminate between center coordinate shapes (e.g. circles) and
top-left coordinate shapes (e.g. rectangles) when determining the
calculations to use for detecting off-screen shape nudges.