avoid reading the scroll position twice
Merge pull request #2387 from fabiomcosta/avoid_double_scrollread

avoid reading the scroll position twice