- SCM ax = gh_cons (sa1, SCM_EOL);
- if (a1 != a2)
- ax= gh_cons (sa2, ax);
- me->set_elt_property ("axes", ax);
+ extract_grob_set (me, "elements", elts);
+
+ vector<Grob*> relevant_elts;
+ SCM is_relevant = ly_lily_module_constant ("pure-relevant");
+
+ for (vsize i = 0; i < elts.size (); i++)
+ {
+ if (to_boolean (scm_apply_1 (is_relevant, elts[i]->self_scm (), SCM_EOL)))
+ relevant_elts.push_back (elts[i]);
+
+ Item *it = dynamic_cast<Item*> (elts[i]);
+ Direction d = LEFT;
+ if (it)
+ do
+ {
+ Item *piece = it->find_prebroken_piece (d);
+ if (piece && to_boolean (scm_apply_1 (is_relevant, piece->self_scm (), SCM_EOL)))
+ relevant_elts.push_back (piece);
+ }
+ while (flip (&d) != LEFT);
+ }
+
+ common = common_refpoint_of_array (relevant_elts, me, Y_AXIS);
+ me->set_object ("common-refpoint-of-elements", common->self_scm ());
+
+ SCM ga_scm = Grob_array::make_array ();
+ Grob_array *ga = unsmob_grob_array (ga_scm);
+ ga->set_array (relevant_elts);
+ me->set_object ("pure-relevant-elements", ga_scm);