+
+MAKE_SCHEME_CALLBACK(Tie, calc_direction, 1);
+SCM
+Tie::calc_direction (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Grob *yparent = me->get_parent (Y_AXIS);
+ if (Tie_column::has_interface (yparent)
+ && unsmob_grob_array (yparent->get_object ("ties"))
+ && unsmob_grob_array (yparent->get_object ("ties"))->size () > 1)
+ {
+ /* trigger positioning. */
+ (void) yparent->get_property ("positioning-done");
+ }
+ else
+ set_grob_direction (me, Tie::get_default_dir (me));
+
+ return SCM_UNSPECIFIED;
+}
+
+
+void
+Tie::set_default_control_points (Grob *me_grob)
+{
+ Spanner *me = dynamic_cast<Spanner*> (me_grob);
+ Grob *common = me;
+ common = me->get_bound (LEFT)->common_refpoint (common, X_AXIS);
+ common = me->get_bound (RIGHT)->common_refpoint (common, X_AXIS);
+
+ Tie_formatting_problem problem;
+ problem.from_tie (me);
+
+ // get_configuration (me, &conf, problem);
+ int tie_position = (int) Tie::get_position (me);
+ Tie_configuration conf
+ = problem.find_optimal_tie_configuration (tie_position, get_grob_direction (me));
+ set_control_points (me, problem.common_x_refpoint (),
+ conf, problem.details_);
+}
+