Optimize Drawing and fix white line on popup windows