bugfix

modified a bug in snapping the first segment of the curve.