fix placement relative to tall elements

If the element is very tall, prevent the tooltip from being pushed offscreen; make sure that the placement of the arrow cannot escape the range of 0-50% of tooltip height or width
fix broken change.

got the min and the max backwards; sorry
Merge pull request #235 from Meshfire/master

fix placement relative to tall elements