Prevent tooltips from exceeding the drawing area