update repaint and reflow