fixing bug on some devices caused by drawing a line from point to itself