fixing collision detection with tooltip and borders