From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Sun, 18 Jan 2004 22:07:40 +0000 (+0000)
Subject: * lily/line-interface.cc (line): remove thickness from calling interface.
X-Git-Tag: release/2.1.23~212
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2af4951859762ff91689f3d5feac03c11003c758;p=lilypond.git

* lily/line-interface.cc (line): remove thickness from calling interface.

* lily/hairpin.cc: use Line_interface

* lily/line-interface.cc: new file. Line_interface for everything
with dotted/dashed lines.
---

diff --git a/lily/hairpin.cc b/lily/hairpin.cc
index 41e9eef5ef..8693650018 100644
--- a/lily/hairpin.cc
+++ b/lily/hairpin.cc
@@ -119,9 +119,7 @@ Hairpin::brew_molecule (SCM smob)
    */
 
   Molecule mol;
-  mol  = Line_interface::line (me,
-				      Offset (0, starth),
-				      Offset (width, endh));
+  mol  = Line_interface::line (me, Offset (0, starth), Offset (width, endh));
   mol.add_molecule (Line_interface::line (me,
 						 Offset (0, -starth),
 						 Offset (width, -endh)));
diff --git a/lily/line-interface.cc b/lily/line-interface.cc
index e3660924f8..41f272c90a 100644
--- a/lily/line-interface.cc
+++ b/lily/line-interface.cc
@@ -73,14 +73,14 @@ Line_interface::line (Grob *me, Offset from, Offset to)
 {
   Real thick = me->get_paper()->get_realvar (ly_symbol2scm ("linethickness"));  
   thick *= robust_scm2double (me->get_grob_property ("thickness"), 1.0); // todo: staff sym referencer? 
-  
+
   SCM type = me->get_grob_property ("style");
-  if (type == ly_symbol2scm ("dotted-line")
-      || type == ly_symbol2scm ("dashed-line"))
+
+  SCM dash_fraction = me->get_grob_property ("dash-fraction");
+  if (gh_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
     {
       Real fraction =
-	robust_scm2double (me->get_grob_property ("dash-fraction"),
-			   (type == ly_symbol2scm ("dotted-line")) ? 0.0 : 0.4);
+	robust_scm2double (dash_fraction, (type == ly_symbol2scm ("dotted-line")) ? 0.0 : 0.4);
 
       fraction = (fraction >? 0) <? 1.0;
       Real period = Staff_symbol_referencer::staff_space (me)
@@ -88,7 +88,7 @@ Line_interface::line (Grob *me, Offset from, Offset to)
 
       if (period < 0)
 	return Molecule ();
-	
+  
       return make_dashed_line (thick, from, to, period, fraction);
     }
   else