Fix smooth scrolling when zoomed.

Use a tolerance when checking scrolling to fix zoomed scrolls.

This fixes #1322, fixes #1321 and hopefully makes #1320 redundant.

@philc can you merge this and push to the web store to fix all the smooth scrolling issues?