fix(line): don't calculate waypoint indices until they're actually required