]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-symbol-referencer.cc
2003 -> 2004
[lilypond.git] / lily / staff-symbol-referencer.cc
index 47e6977ff827ff89a35c1296223a2312b5adc89a..cfb871d575cb4b8071da5d31f36214643312d5d1 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
  */
 
 #include <math.h>
@@ -51,6 +51,16 @@ Staff_symbol_referencer::staff_space (Grob*me)
   return 1.0;
 }
 
+Real
+Staff_symbol_referencer::line_thickness (Grob*me) 
+{
+  Grob * st = get_staff_symbol (me);
+  if (st)
+    return Staff_symbol::get_line_thickness (st);
+
+  return me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+}
+
 Real
 Staff_symbol_referencer::get_position (Grob*me) 
 {
@@ -63,15 +73,10 @@ Staff_symbol_referencer::get_position (Grob*me)
        - st->relative_coordinate (c, Y_AXIS);
 
       p += 2.0 * y / Staff_symbol::staff_space (st);
+      return p;
     }
-  else
-    {
-      SCM pos = me->get_grob_property ("staff-position");
-      if (gh_number_p (pos))
-       return gh_scm2double (pos);
-    }
-  
-  return  p;
+
+  return robust_scm2double ( me->get_grob_property ("staff-position"), p);
 }