void
Axis_group_interface::add_element (Score_element *e)
{
-
- // ugh. used_b_ should be junked.
- elt_l_->used_b_ = true;
- e->used_b_ = true;
-
for (SCM ax = elt_l_->get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
{
Axis a = (Axis) gh_scm2int (gh_car (ax));
if (!has_interface_b ())
{
elt_l_->set_elt_pointer ("elements", SCM_EOL);
- elt_l_->set_elt_property ("transparent", SCM_BOOL_T); // junk this?
- elt_l_->set_elt_property ("axes" , SCM_EOL);
+
+
Group_interface (elt_l_, "interfaces").add_thing (ly_symbol2scm ("Axis_group"));
}
}
void
Axis_group_interface::set_axes (Axis a1, Axis a2)
{
- // set_interface () ?
-
- SCM ax = gh_cons (gh_int2scm (a1), SCM_EOL);
- if (a1 != a2)
- ax= gh_cons (gh_int2scm (a2), ax);
+ // set_interface () ?
+ SCM sa1= gh_int2scm (a1);
+ SCM sa2 = gh_int2scm (a2);
+ SCM prop = elt_l_->get_elt_property ("axes");
- elt_l_->set_elt_property ("axes", ax);
+ if (prop == SCM_UNDEFINED
+ || scm_memq (sa1, prop) == SCM_BOOL_F
+ || scm_memq (sa2, prop) == SCM_BOOL_F)
+ {
+ SCM ax = gh_cons (sa1, SCM_EOL);
+ if (a1 != a2)
+ ax= gh_cons (sa2, ax);
+ elt_l_->set_elt_property ("axes", ax);
+ }
if (a1 != X_AXIS && a2 != X_AXIS)
elt_l_->set_extent_callback (0, X_AXIS);