fix auto-scroll calculation
Merge pull request #125 from wolfmanx/fix-auto-scroll

fix auto-scroll calculation