I love this, but it does not seem to conform to standard UX best practices.
If I click and hold then move the mouse away to release, I assume an element should not register that as a click. As-is, this is inconsistent: the button registers a click, the checkbox does not.
Good catch. I've updated the button logic. The click will no longer trigger if the cursor is outside the button boundary.
I always had this issue when working with Flash developers. A common mantra was "don't reimplement scrollbars unless you can implement all the features a scrollbar comes with." They always had to do more than five iterations and spent days on that scrollbar.