Optimizing drawing