Improve tooltip rendering near edges.

Reviewer: Lisa
Compile the files.