- Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
- assert (a == Y_AXIS);
- me = me->get_parent (X_AXIS);
-
- if (!to_boolean (me->get_grob_property ("collision-done")))
- {
- me->set_grob_property ("collision-done", SCM_BOOL_T);
-
- do_shifts (me);
- }
- return gh_double2scm (0.0);
-}
-
-MAKE_SCHEME_CALLBACK(Dot_column,side_position, 2);
-SCM
-Dot_column::side_position (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
- assert (a == X_AXIS);
-
- Grob * stem = unsmob_grob (me->get_grob_property ("stem"));
- if (stem
- && !Stem::get_beam (stem)
- && Stem::duration_log (stem) > 2
- && !Stem::invisible_b (stem)
- )
- {
- /*
- trigger stem end & direction calculation.
-
- This will add the stem to the support if a flag collision happens.
- */
- Stem::stem_end_position (stem);
- }
- return Side_position_interface::aligned_side (element_smob, axis);
-}
-
-
-
-struct Dot_position
-{
- int pos_;
- Direction dir_;
- Grob *dot_;
- bool extremal_head_;
-
-
- Dot_position ()
- {
- dot_ = 0;
- pos_ =0;
- dir_ = CENTER;
+ Grob *me = unsmob_grob (smob);
+
+ me->set_property ("positioning-done", SCM_BOOL_T);
+
+ vector<Grob*> dots
+ = extract_grob_array (me, "dots");
+
+ vector<Grob*> main_heads;
+ Real ss = 0;
+
+ Grob *commonx = me;
+ { /*
+ Trigger note collision resolution first, since that may kill off
+ dots when merging.
+ */
+ for (vsize i = 0; i < dots.size (); i++)
+ {
+ Grob *n = dots[i]->get_parent (Y_AXIS);
+ commonx = n->common_refpoint (commonx, X_AXIS);
+
+ if (Grob *stem = unsmob_grob (n->get_object("stem")))
+ {
+ commonx = stem->common_refpoint (commonx, X_AXIS);
+
+ if (Stem::first_head (stem) == n)
+ main_heads.push_back (n);
+ }
+ }