proper drawing when buffer is lost or restored