]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/local-key-item.cc
release: 1.3.19
[lilypond.git] / lily / local-key-item.cc
index 72c7104e4abfdf3e856242bbf8937dafbac11e5e..7541177600ffa58bb77430b695391c3330b07d84 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #include "local-key-item.hh"
 #include "molecule.hh"
@@ -17,7 +17,6 @@
 
 Local_key_item::Local_key_item ()
 {
-  c0_position_i_ = 0;
 }
 
 void
@@ -69,7 +68,7 @@ Local_key_item::do_brew_molecule_p() const
 {
   Molecule*output = new Molecule;
   Staff_symbol_referencer_interface si (this);
-  Real note_distance = si.staff_line_leading_f ()/2;
+  Real note_distance = si.staff_space ()/2;
   Molecule *octave_mol_p = 0;
   int lastoct = -100;
   
@@ -90,13 +89,14 @@ Local_key_item::do_brew_molecule_p() const
        }
       
       lastoct = p.octave_i_;
-      Real dy =
-       (c0_position_i_ + p.notename_i_)
+
+      SCM c0 =  get_elt_property ("c0-position");
+      Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_)
        * note_distance;
       
       Molecule m (accidental (p.accidental_i_,
-                                 accidental_arr_[i].cautionary_b_,
-                                 accidental_arr_[i].natural_b_));
+                             accidental_arr_[i].cautionary_b_,
+                             accidental_arr_[i].natural_b_));
 
       m.translate_axis (dy, Y_AXIS);
       octave_mol_p->add_at_edge (X_AXIS, RIGHT, m, 0);