Update clear/redraw function to manage transparency