]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/axis-group-interface.cc
release: 1.3.56
[lilypond.git] / lily / axis-group-interface.cc
index a08865c19cd9207144b9ba53854acab1115da6ee..00c4c8d32c02145beb4878160843d6cbeb8371af 100644 (file)
@@ -25,11 +25,6 @@ Axis_group_interface (Score_element*s)
 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));
@@ -86,8 +81,8 @@ Axis_group_interface::set_interface ()
   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"));
     }
 }
@@ -95,14 +90,21 @@ Axis_group_interface::set_interface ()
 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);