]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/hairpin.cc
* mf/GNUmakefile: always trace pfa fonts.
[lilypond.git] / lily / hairpin.cc
index a069fb0079aeb4838fcbcfb752a29a4ce60afc80..c757f4ce1e645facc3dc3761c6a85a6ca23f53c7 100644 (file)
@@ -27,7 +27,7 @@ Hairpin::brew_molecule (SCM smob)
   Real line = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));  
   
   SCM s = me->get_grob_property ("grow-direction");
-  if (!ly_dir_p (s))
+  if (!is_direction (s))
     {
       me->suicide ();
       return SCM_EOL;
@@ -133,19 +133,31 @@ Hairpin::brew_molecule (SCM smob)
   /*
     TODO: set line style.
    */
-  Molecule mol  = Lookup::dashed_line (thick,
-                               Offset (0, starth),
-                               Offset (width, endh),
-                               period, fraction);
-  mol.add_molecule (Lookup::dashed_line (thick,
-                                 Offset (0, -starth),
-                                 Offset (width, -endh),
-                                 period, fraction));
-  
+  Molecule mol;
+  if (fraction < 1.0)
+    {
+      mol  = Lookup::dashed_line (thick,
+                                 Offset (0, starth),
+                                 Offset (width, endh),
+                                 period, fraction);
+      mol.add_molecule (Lookup::dashed_line (thick,
+                                            Offset (0, -starth),
+                                            Offset (width, -endh),
+                                            period, fraction));
+    }
+  else
+    {
+      mol  = Lookup::line (thick,
+                          Offset (0, starth),
+                          Offset (width, endh));
+      mol.add_molecule (Lookup::line (thick,
+                                     Offset (0, -starth),
+                                     Offset (width, -endh)
+                                     ));
+    }
   mol.translate_axis (x_points[LEFT]
                      - bounds[LEFT]->relative_coordinate (common, X_AXIS),
                      X_AXIS);
-
   return mol.smobbed_copy ();
 }