by qianjun;fix scrollbar bug,makes it work better

优化滚动视窗计算逻辑