Hit detection of mouse in rotated rectangle

In the chat @bjoern and @elektromeier pointed me to this solution:

inverse transform the mouse coordinate with the transformation of the rect
then you can check the range i think its -0.5 to 0.5

The patch from the screenshot is in VL.Addons