]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/measure-grouping-spanner.cc
($(outdir)/%.pdf): add DVIPS_FLAGS. This will
[lilypond.git] / lily / measure-grouping-spanner.cc
index 9af72c3405334aee3949a8d9dbcb50686523e6eb..2896a3d8e8730c57ce24672887f94ab908ed2171 100644 (file)
@@ -1,20 +1,22 @@
 /*   
-measure-grouping-spanner.cc --  implement Measure_grouping
+       measure-grouping-spanner.cc --  implement Measure_grouping
 
-source file of the GNU LilyPond music typesetter
+       source file of the GNU LilyPond music typesetter
 
-(c) 2002--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+       (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
  */
+
 #include "paper-def.hh"
 #include "spanner.hh"
 #include "measure-grouping-spanner.hh"
 #include "lookup.hh" 
 #include "item.hh"
+#include "staff-symbol-referencer.hh"
 
-MAKE_SCHEME_CALLBACK (Measure_grouping, brew_molecule, 1);
+MAKE_SCHEME_CALLBACK (Measure_grouping, print, 1);
 SCM 
-Measure_grouping::brew_molecule (SCM grob)
+Measure_grouping::print (SCM grob)
 {
   Spanner * me = dynamic_cast<Spanner*> (unsmob_grob (grob));
 
@@ -22,10 +24,9 @@ Measure_grouping::brew_molecule (SCM grob)
     TODO: robustify.
    */
   SCM which = me->get_grob_property ("style");
-  SCM thick = me->get_grob_property ("thickness");
-  SCM height = me->get_grob_property ("height");
+  Real height = robust_scm2double (me->get_grob_property ("height"), 1);
 
-  Real t = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) * gh_scm2double (thick); 
+  Real t = Staff_symbol_referencer::line_thickness (me) * robust_scm2double (me->get_grob_property ("thickness"), 1);
   Grob *common = me->get_bound(LEFT)->common_refpoint (me->get_bound (RIGHT),
                                                       X_AXIS);
 
@@ -39,18 +40,18 @@ Measure_grouping::brew_molecule (SCM grob)
 
   Interval iv (0,w);
 
-  Molecule m;
+  Stencil m;
 
   /*
     TODO: use line interface
    */
   if (which == ly_symbol2scm ("bracket"))
     {
-      m = Lookup::bracket (X_AXIS, iv, t,-gh_scm2double (height), t);
+      m = Lookup::bracket (X_AXIS, iv, t, -height, t);
     }
   else if (which == ly_symbol2scm ("triangle"))
     {
-      m = Lookup::triangle (iv, t, gh_scm2double (height));
+      m = Lookup::triangle (iv, t, height);
     }
 
   m.align_to (Y_AXIS, DOWN);