corrected bug where a line ending close to the origin is not drawn