fix hex mode repaint under windows