move drag logic and repaint to RAF