Take PinnedOffsetY into account when deciding whether to stay in top mode

This has the effect of pinning at a point lower than the top of the
viewport