Fix tooltip rendering
Fix tooltip rendering

* fix calculation of best tooltip position, which could lead to a
  tooltip being positioned outside of the screen
* fix positioning of tooltip tip

This should fix ticket #1

Patternslib/Patterns-archive,Patternslib/Patterns-archive,Patternslib/require-experimental-build,Patternslib/Patterns-archive