Update: It has something to do with the elements inside the building elements, when you remove the building-content and building-icon elements, the issue is no longer present. Confusingly, in the following line of code, changing mousePos.y - tooltip.offsetHeight/2 to mousePos.y - 50 (or any other integer) will also fix the bug, although there appears to be no issue with the mouse's Y position or the offsetHeight of the tooltip.
Fixed by having both onmouseover AND onmousemove attached to the building element, not sure why it actually was broken in the first place, though, will look into why in 0.7 and ways it can be improved.
Update: It has something to do with the elements inside the building elements, when you remove the
building-content
andbuilding-icon
elements, the issue is no longer present. Confusingly, in the following line of code, changingmousePos.y - tooltip.offsetHeight/2
tomousePos.y - 50
(or any other integer) will also fix the bug, although there appears to be no issue with the mouse's Y position or the offsetHeight of the tooltip.The
clamp()
function has no effect on the bug.