]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-symbol-referencer.cc
Run grand replace for 2015.
[lilypond.git] / lily / staff-symbol-referencer.cc
index b18bb04fa3b8f7f2dd6b8d60206e09ac2fb08863..89863d0e43b647df80e945f8dce3856e825980ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1999--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ Staff_symbol_referencer::get_staff_symbol (Grob *me)
     return me;
 
   SCM st = me->get_object ("staff-symbol");
-  return unsmob_grob (st);
+  return Grob::unsmob (st);
 }
 
 Real
@@ -138,7 +138,7 @@ MAKE_SCHEME_CALLBACK (Staff_symbol_referencer, callback, 1);
 SCM
 Staff_symbol_referencer::callback (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
 
   SCM pos = me->get_property ("staff-position");
   Real off = 0.0;
@@ -189,11 +189,23 @@ Staff_symbol_referencer::internal_set_position (Grob *me, Real p, bool pure)
   me->translate_axis ((p - oldpos) * ss * 0.5, Y_AXIS);
 }
 
-/* Half of the height, in staff space, i.e. 2.0 for a normal staff. */
+Interval
+Staff_symbol_referencer::staff_span (Grob *me)
+{
+  Interval result;
+  if (me)
+    if (Grob *symb = get_staff_symbol (me))
+      result = Staff_symbol::line_span (symb);
+  return result;
+}
+
 Real
 Staff_symbol_referencer::staff_radius (Grob *me)
 {
-  return (line_count (me) - 1) / 2.0;
+  /*
+    line_span is measured in pitch steps, not in staff spaces
+  */
+  return staff_span (me).length () / 4.0;
 }
 
 int