Correction to tooltip placement calculation

Fixes #13897.
Per @RR2DO2 in #12284.

CC: @fat for review