Fix scrolling in 1.47, all cases.

Fixes all of the smooth scrolling issues with 1.46.
Also fixes #1330.

Remaining problems (only when zoomed):
- The final position of some scrolls may be off by a fractional amount.

Edit:  Also addresses the issues raised (by me) in #1327.)