Fixed a bug with drawing dashes when saving image to a file