corrects painting of entities while printing and exporting

Solves #199.