2 lyric-extender.cc -- implement Lyric_extender
3 source file of the GNU LilyPond music typesetter
5 (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "dimension-cache.hh"
13 #include "molecule.hh"
14 #include "paper-column.hh"
15 #include "paper-def.hh"
16 #include "lyric-extender.hh"
19 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Lyric_extender
,brew_molecule
)
21 Lyric_extender::brew_molecule (SCM smob
)
23 Spanner
*sp
= dynamic_cast<Spanner
*> (unsmob_element (smob
));
25 Real leftext
= sp
->get_bound (LEFT
)->extent (X_AXIS
).length ();
26 Real ss
= sp
->paper_l ()->get_var ("staffspace");
27 Real w
= sp
->spanner_length () - leftext
- ss
/2;
29 Real h
= sp
->paper_l ()->get_var ("extender_height");
30 Molecule
mol (sp
->lookup_l ()->filledbox ( Box (Interval (0,w
), Interval (0,h
))));
31 mol
.translate (Offset (leftext
, 0));
32 return mol
.create_scheme();
36 Lyric_extender::set_textitem (Direction d
, Score_element
*s
)
38 elt_l_
->set_bound (d
, s
);
39 elt_l_
->add_dependency (s
);
42 Lyric_extender::Lyric_extender (Spanner
*s
)