/*
- 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--2011 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"
{
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;
curve.control_[1] -= perp;
curve.control_[2] -= perp;
- 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++)
{
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;
Real seg_length = (back_segment.control_[3] -
back_segment.control_[0]).length ();
- int pattern_count = seg_length / dash_period;
+ int pattern_count = (int) (seg_length / dash_period);
Real pattern_length = 1.0 / (pattern_count + dash_fraction);
Real start_t, end_t;
for (int p = 0; p <= pattern_count; p++)
linethick));
}
}
- }/* end for num_segments */
- }/* end dashed or combination slur */
+ }
+ }
return return_value;
}
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);