Position tooltips in the visible area (#15129).

Change-Id: If4f13a859fd2e6fc363781bf04e52f780206e9e1