automatically close drawn strokes in the DrawPanel