Optimized fill algorithm and drawing