move repaint into canvas