fix paint drawing bug in windows