if your case it might hurt due to the left is be undefined (see https://github.com/mozilla/pdf.js/pull/4188/files#diff-3c5a405b7edf7f3f910c074ab5a703aaR407). Please revert two of those changes, since it's not relevant and can make offsetX == NaN