updatescrollbar at end of handlepaint