refactored and commented to more closely match the "pointerEvents / hand.js" version of croppy