X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftex-beam.cc;h=c16a0e9c02a722e0b65da52327b4072a75926be1;hb=2862b1027f316a2f0444fa92e441ee28acf7a463;hp=f20ded05e4c4b27fe30fd781c2d0001cc488a499;hpb=68ffccad7c4d4ce0386cb60c537c99523e61c4d9;p=lilypond.git diff --git a/lily/tex-beam.cc b/lily/tex-beam.cc index f20ded05e4..c16a0e9c02 100644 --- a/lily/tex-beam.cc +++ b/lily/tex-beam.cc @@ -1,7 +1,13 @@ /* + tex-beam.cc -- implement Lookup::{beam_element, beam, rule_symbol} + source file of the GNU LilyPond music typesetter + + (c) 1996,1997 Han-Wen Nienhuys +*/ + +/* Code to generate beams for TeX - */ #include @@ -35,17 +41,17 @@ slope_index (Real &s) { if (abs (s) > 0.5) { - WARN << "beam steeper than 0.5 (" << s << ")\n"; - s = sign (s) * 0.5; + WARN << "beam steeper than 0.5 (" << s << ")\n"; + s = sign (s) * 0.5; } int i = int (rint (s * 20.0)); s = i/20.0; if (s>0) - return 6*i +122; + return 6*i +122; else - return -6 * i+ 186; + return -6 * i+ 186; } Symbol @@ -66,11 +72,11 @@ Lookup::beam (Real &slope, Real width) const { int sidx = slope_index (slope); if (!slope) - return rule_symbol (2 PT, width); + return rule_symbol (2 PT, width); if (width < 2 PT) { - WARN<<"Beam too narrow. (" << print_dimen (width) <<")\n"; - width = 2 PT; + WARN<<"Beam too narrow. (" << print_dimen (width) <<")\n"; + width = 2 PT; } Real elemwidth = 64 PT; int widx = 5; @@ -79,8 +85,8 @@ Lookup::beam (Real &slope, Real width) const while (elemwidth > width) { - widx --; - elemwidth /= 2.0; + widx --; + elemwidth /= 2.0; } Real overlap = elemwidth/4; Real last_x = width - elemwidth; @@ -90,10 +96,10 @@ Lookup::beam (Real &slope, Real width) const m.add (a); while (x < last_x) { - a=elem; - a.translate (Offset (x-overlap, (x-overlap)*slope)); - m.add (a); - x += elemwidth - overlap; + a=elem; + a.translate (Offset (x-overlap, (x-overlap)*slope)); + m.add (a); + x += elemwidth - overlap; } a=elem; a.translate (Offset (last_x, (last_x) * slope));