]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lookup.cc
Fix Page_breaking::min_page_count on ragged pages.
[lilypond.git] / lily / lookup.cc
index f856fa5be931541b95a2a6e1828759826d8d7e2b..207dd06bf444e242740ae7dc5ac11cada8afad2d 100644 (file)
@@ -1,11 +1,22 @@
 /*
-  lookup.cc -- implement simple Lookup methods.
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   Jan Nieuwenhuizen <janneke@gnu.org>
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "lookup.hh"
@@ -348,8 +359,9 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick,
 {
   Stencil return_value;
 
-  /* calculate the offset for the two beziers that make the sandwich
-   *   for the slur
+  /* 
+      calculate the offset for the two beziers that make the sandwich
+      for the slur
   */
   Real alpha = (curve.control_[3] - curve.control_[0]).arg ();
   Bezier back = curve;
@@ -360,22 +372,14 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick,
   curve.control_[1] -= perp;
   curve.control_[2] -= perp;
  
-/*  Bezier test1, test2, test3, test4;
-  test1 = back.extract(0., 1.0) ;
-  test2 = curve.extract (0., 1.0);
-  test3 = back.extract(0.0, 0.2);
-  test4 = curve.extract (0.0, 0.2);
-  return_value = bezier_sandwich (test1, test2, linethick);
-//  return_value.add_stencil (
-//      bezier_sandwich (test3, test4, linethick));
-  return return_value; */
-
-  if ((dash_details == SCM_UNDEFINED) || (dash_details == SCM_EOL))
-    { /* solid slur  */
+  if (!scm_is_pair (dash_details))
+    { 
+      /* solid slur  */
       return_value = bezier_sandwich (back, curve, linethick);
     }
   else
-    { /* dashed or combination slur */
+    { 
+      /* dashed or combination slur */
       int num_segments = scm_to_int (scm_length (dash_details));
       for (int i=0; i<num_segments; i++)
         {
@@ -389,11 +393,9 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick,
           Bezier back_segment = back.extract (t_min, t_max);
           Bezier curve_segment = curve.extract (t_min, t_max);
           if (dash_fraction == 1.0) 
-            {
               return_value.add_stencil (bezier_sandwich (back_segment,
                                                          curve_segment,
                                                          linethick));
-            }
           else
             {
               Bezier back_dash, curve_dash;
@@ -415,8 +417,8 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick,
                                                              linethick));
                 }
             }
-        }/* end for num_segments */
-    }/* end dashed or combination slur */
+        }
+    }
   return return_value;
 }
 
@@ -532,6 +534,7 @@ Lookup::triangle (Interval iv, Real thick, Real protrude)
   points.push_back (Offset (iv[LEFT], 0));
   points.push_back (Offset (iv[RIGHT], 0));
   points.push_back (Offset (iv.center (), protrude));
+  points.push_back (Offset (iv[LEFT], 0));  // close triangle
 
   return points_to_line_stencil (thick, points);