Prevent the tooltip from overhanging the right side of the screen

Large tooltips were hovering beyond the bounds of the window. This fix shifts the rightmost tooltips to the left instead