+ // fake the current tangent if we need to
+ if (zero_tangent) tangent = curve(FAKE_TANGENT_STEP) - curve(0);
+
+ // calculate the other tangent
+ Vector other_tangent(iter->get_tangent1());
+ if (other_tangent[0] == 0 && other_tangent[1] == 0)
+ {
+ // find the previous blinepoint
+ std::vector<synfig::BLinePoint>::const_iterator prev;
+ if (iter != bline.begin()) (prev = iter)--;
+ else if (loop) (prev = bline.end())--;
+ else prev = iter;
+
+ etl::hermite<Vector> other_curve(prev->get_vertex(), iter->get_vertex(), prev->get_tangent2(), iter->get_tangent1());
+ other_tangent = other_curve(1) - other_curve(1-FAKE_TANGENT_STEP);
+ }
+
+ // normalise and sum the two tangents
+ tangent=(other_tangent.norm()+tangent.norm());