Update line.class.js

Fix situation where line is drawn incorrectly if it doesn't go from top left to bottom right.