Fix for flashing when painting textures.