Canvas rotate centered around where the cursor is pressed instead of just screen center as another option to rotation

I made a little plugin with this feature:

I hope it will work fine if someone stubmbles upon this thread.