track->remove_attachment(*this);
}
+float TrackAttachment::get_offset_from_endpoint(unsigned epi) const
+{
+ if(epi==track.entry())
+ return offset;
+ else
+ return track->get_type().get_path_length(0)-offset;
+}
+
void TrackAttachment::attach_to(const TrackIter &t, float o)
{
if(track)
Vector epp = trk->get_snap_node(trk.entry()).position;
float dist = distance(epp, point);
- float offs = dist;
+ float offs = min(dist, trk->get_type().get_path_length(0));
while(1)
{
TrackPoint tp = trk->get_point(trk.entry(), offs);