Fixed issue where clicks were registering lower and more to the right than expected. This is because I was using clientX and clientY, which are relative to the viewport, rather than offsetX and offsetY.