implemented edge scrolling while drawing