fix tooltip positioning when on margins or greater than screen