Fixes tooltips from running off the screen; wraps long tooltip lines and flips overflowing tooltips to the other side of the cursor.