fix affix overscroll problems

top offset was not calculated correctly. fixes #9650 and #9661