switching directions while drawing line