fixed draw logic

changed the way the progressbar gets drawn. this should fix the issues that sometimes the progressbar looked as if it would break apart. also optimised the code slightly.