Calculates tooltips position correctly