fixed calculating scroll offset when moving scrollbar