add validation that line is within canvas