Fix #13897 by correcting tooltip placement calculation

Per @RR2DO2 in #12284. Thanks @RR2DO2!