How could you cache this instead of reaching into the DOM to find it every time a line is drawn?