]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/figured-bass-continuation.cc
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / lily / figured-bass-continuation.cc
index 6034a34641a0e0b6bfc86c23cc58550155408816..bb84bb3c3ef73f510332a7c7f9222e6130e88fca 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -30,7 +30,6 @@
 
 struct Figured_bass_continuation
 {
-  DECLARE_GROB_INTERFACE ();
 
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
@@ -41,7 +40,7 @@ MAKE_SCHEME_CALLBACK (Figured_bass_continuation, center_on_figures, 1);
 SCM
 Figured_bass_continuation::center_on_figures (SCM grob)
 {
-  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (grob));
+  Spanner *me = unsmob<Spanner> (grob);
   extract_grob_set (me, "figures", figures);
   if (figures.empty ())
     return scm_from_double (0.0);
@@ -57,17 +56,17 @@ MAKE_SCHEME_CALLBACK (Figured_bass_continuation, print, 1);
 SCM
 Figured_bass_continuation::print (SCM grob)
 {
-  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (grob));
+  Spanner *me = unsmob<Spanner> (grob);
 
   Real thick
     = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"))
       * robust_scm2double (me->get_property ("thickness"), 1);
 
   Interval spanned;
-  Direction d = LEFT;
+
   Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT),
                                                         X_AXIS);
-  do
+  for (LEFT_and_RIGHT (d))
     {
       Item *bound = me->get_bound (d);
       Direction extdir
@@ -78,7 +77,6 @@ Figured_bass_continuation::print (SCM grob)
         = robust_relative_extent (bound, common, X_AXIS)[extdir]
           - me->relative_coordinate (common, X_AXIS);
     }
-  while (flip (&d) != LEFT);
   spanned.widen (- robust_scm2double (me->get_property ("padding"), 0.2));
 
   Stencil extender;